SlideShare a Scribd company logo
Configuration Management
and
Deployment with Ansible
Иван Димитров
Manager Technical
Operations
Xogito Group, Inc
ivan.dimitrov@xogito.com
Application Deployment
Configuration Management
Ad-Hoc Execution
Rolling Updates
Multi Tier Deployment
Cloud Provisioning
Какво е Ansible
for i in `cat servers` ; do ssh ubuntu@$i “sudo
apt-get update && sudo apt-get -y install bash”
; done
“It works on my laptop’s virtual machine!”
ssh based && agentless
Лесен за използване и разбиране
Какво е Ansible
Inventory
[webservers]
web1.host.com
web2.host.com
[databases]
db1.host.com
db2.host.com
[linuxes:children]
webservers
databases
file
ssh_config
Cobler
AWS
Digital Ocean
OpenStack
RackSpace
Еднократни команди
$ ansible webservers -i hosts -m ping
web1.host.com | success >> {
"changed": false,
"ping": "pong"
}
web2.host.com | success >> {
"changed": false,
"ping": "pong"
}
$ ansible linuxes -i hosts -m shell -a "yum update bash" -s
Playbooks
$ cat websites.yml
---
- hosts: websites
user: ec2-user
sudo: yes
vars:
hostname: web1.host.com
website_home: "/var/www/website.host.com"
Playbooks
roles:
- common
- datadog
- nagios-agent
- httpd
- website.app
Roles
roles/
common/
tasks/
files/
handlers/
templates/
vars/
website/
tasks/
…./
Tasks
$ cat roles/common/tasks/main.yml
- name: Orcestrate all our instances
template: src=motd dest=/etc/motd
- name: Change bashrc
copy: src=bashrc dest=/etc/bashrc
- name: Install Development Tools
yum: name="@Development tools" state=present
Tasks
$ cat roles/httpd/tasks/main.yml
- name: Install httpd
yum: name=httpd state=present
- name: Copy httpd.conf template
template: src=httpd.conf dest=/etc/apache/httpd.conf owner=apache
mode=0644
- name: Ensure that httpd is running
service: name=httpd state=started enabled=yes
Tasks
- name: Checkout repository from bitbucket
git: repo=git@bitbucket.org:my-company/website.git
dest={{ website_home }}
update={{ website_deploy }}
accept_hostkey=yes
version={{ website_branch }}
sudo: yes
sudo_user: "{{ website_user }}"
notify:
- restart my-website-app
Configuration management and deployment with ansible
Modules
Batteries included - ~300 modules
From copying of files to mysql setup
Easy to write
Plugins
Inventory plugins
Connection plugins
Action plugins
Lookup Plugins
Vars Plugins
Filter Plugins
Demo
Tips
Continuous Integration && Continuous Delivery
Different inventory files and variables
Vagrant, Docker
Jenkins
if [ -f /usr/local/ansible/hacking/env-setup ] ; then
source /usr/local/ansible/hacking/env-setup -q
fi
ansible-playbook -i hosts.dev website.app.yml --start-at-task="Add website
user" -e "website_deploy=yes"
Връзки
http://www.ansible.com/
http://www.ansible.com/tower
https://galaxy.ansible.com/
http://docs.ansible.com/
https://github.com/ansible/ansible
Благодаря && Въпроси

More Related Content

PPTX
Ansible & CloudStack - Configuration Management
PDF
Deploying SharePoint @ Cloud
PDF
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
PDF
Usecase examples of Packer
PDF
Automating CloudStack with Puppet - David Nalley
ODP
Puppet and Apache CloudStack
PPTX
Packer, where DevOps begins
PDF
Rackspace Hack Night - Vagrant & Packer
Ansible & CloudStack - Configuration Management
Deploying SharePoint @ Cloud
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Usecase examples of Packer
Automating CloudStack with Puppet - David Nalley
Puppet and Apache CloudStack
Packer, where DevOps begins
Rackspace Hack Night - Vagrant & Packer

What's hot (20)

PDF
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30th
PDF
Managing Your Cisco Datacenter Network with Ansible
PDF
OpenSource ToolChain for the Hybrid Cloud
PDF
Automating the Network
PPTX
So I Wrote a Manifest
PPTX
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
PDF
Integrating cloud stack with puppet
PDF
Ansible Case Studies
PDF
Bacd zenoss
PDF
Ansible + Drupal: A Fortuitous DevOps Match
PPTX
Automation with Packer and TerraForm
PDF
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
ODP
ansible why ?
PDF
DevOps for Humans - Ansible for Drupal Deployment Victory!
PDF
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
PPTX
Cyansible
ODP
Puppet and CloudStack
ODP
Infrastructure as code with Puppet and Apache CloudStack
PDF
A Introduction of Packer
PDF
Ansible and AWS
MAAS & Ubuntu Core: OCP Tech Day, Facebook Menlo Park, Aug 30th
Managing Your Cisco Datacenter Network with Ansible
OpenSource ToolChain for the Hybrid Cloud
Automating the Network
So I Wrote a Manifest
Introduction to Packer and Suitcase: A Packer-based OS Image Build System
Integrating cloud stack with puppet
Ansible Case Studies
Bacd zenoss
Ansible + Drupal: A Fortuitous DevOps Match
Automation with Packer and TerraForm
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
ansible why ?
DevOps for Humans - Ansible for Drupal Deployment Victory!
Deploying VMware vCloud Hybrid Service with Puppet - PuppetConf 2013
Cyansible
Puppet and CloudStack
Infrastructure as code with Puppet and Apache CloudStack
A Introduction of Packer
Ansible and AWS
Ad

Viewers also liked (10)

PPTX
Spring security
PPTX
Ansible for large scale deployment
PPTX
Ansible for large scale deployment
PDF
Deployment z Ansible
PDF
Ansible Oxford - Cows & Containers
PDF
Ansible Automation to Rule Them All
PDF
Zero Downtime Deployment with Ansible
PDF
Application Deployment Using Ansible
PDF
Infrastructure Deployment with Docker & Ansible
PDF
How to Become a Thought Leader in Your Niche
Spring security
Ansible for large scale deployment
Ansible for large scale deployment
Deployment z Ansible
Ansible Oxford - Cows & Containers
Ansible Automation to Rule Them All
Zero Downtime Deployment with Ansible
Application Deployment Using Ansible
Infrastructure Deployment with Docker & Ansible
How to Become a Thought Leader in Your Niche
Ad

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation theory and applications.pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
MYSQL Presentation for SQL database connectivity
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
Network Security Unit 5.pdf for BCA BBA.
The Rise and Fall of 3GPP – Time for a Sabbatical?
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
Encapsulation theory and applications.pdf
sap open course for s4hana steps from ECC to s4
Advanced methodologies resolving dimensionality complications for autism neur...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
20250228 LYD VKU AI Blended-Learning.pptx
MYSQL Presentation for SQL database connectivity

Configuration management and deployment with ansible