SlideShare a Scribd company logo
Ansible 101
Jeff Geerling
Ansible St. Louis Meetup - July 8, 2015
Who am I?
• Jeff Geerling (geerlingguy)
• Technical Architect, Acquia
• Owner, Midwestern Mac LLC
• Dev (mainly), Ops
Ansible for DevOps
• On LeanPub
• Nearly complete!
• 50% off: http://bit.ly/ansible-stl
My Story
• First 'real' server build: a 486 PC, RedHat Linux 6
Gateway 2000 4DX2-66v
RedHat Linux 6.x
Today
Midwestern Mac Server Check.in Hosted Apache Solr
Personal
= 50+ prod servers,

one very part-time sysadmin
• “Configuration management for humans.”
• Uses SSH
• Secure, fast, simple
• 300+ built-in modules
• Don't need configuration management to manage
your configuration management.
• “Configuration management for humans.”
• Uses SSH
• Secure, fast, simple
• 300+ built-in modules
• Don't need configuration management to manage
your configuration management.
	
  ___________	
  	
  
<	
  And	
  cows!	
  >	
  
	
  -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ^__^	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (oo)_______	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (__)	
  	
  	
  	
  	
  	
  	
  )/	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ||-­‐-­‐-­‐-­‐w	
  |	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ||	
  	
  	
  	
  	
  ||
Installation
• Python pip: sudo pip install ansible
• Mac: brew install ansible
• RHEL/CentOS/Fedora: sudo yum install ansible
• Deb/Ubuntu:

sudo apt-add-repository ppa:ansible/ansible

sudo apt-get update

sudo apt-get install ansible
Ansible 101
1. Inventory: Describe your infrastructure
2. Ad-Hoc commands: Run one-off tasks
3. Playbooks: "Infrastructure as code"
4. Roles: Encapsulate configuration
http://robmyers.org/cc-ironies/no_flash_photography_sign/
Please help me avoid the

Xenon Death Flash
• 6-node Raspberry Pi cluster
CPU 24 cores / 5.4 GHz
RAM 6 GB
Storage 96 GB microSD
Network 10/100 over Gig
https://github.com/geerlingguy/raspberry-pi-dramble
The #Dramble
Inventory
[balancer]
10.0.1.60
[webservers]
10.0.1.61
10.0.1.62
10.0.1.63
10.0.1.64
[database]
10.0.1.65
[dramble:children]
balancer
webservers
database
[dramble:vars]
ansible_ssh_user=pi
• INI-syntax (can also use YAML and dynamic sources)
• Default location: /etc/ansible/hosts (can override with -i)
• Check connectivity (always a good first step!)

$ ansible all -m ping
• Have fun with RGB LEDs!

$ ansible webservers -a "rgb red" -s
Ad-Hoc Commands
• Check connectivity (always a good first step!)

$ ansible all -m ping
• Have fun with RGB LEDs!

$ ansible webservers -a "rgb red" -s
Ad-Hoc Commands
	
  ________	
  
<	
  Shiny!	
  >	
  
	
  -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ^__^	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (oo)_______	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (__)	
  	
  	
  	
  	
  	
  	
  )/	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ||-­‐-­‐-­‐-­‐w	
  |	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ||	
  	
  	
  	
  	
  ||
Demo
# Test connectivity.
ansible all -m ping
# Raspberry Pi RGB LEDs.
ansible all -a "rgb green" -s
ansible all -a "rgb blue" -s --forks=1
ansible all -a "rgb green" -s --forks=2
ansible all -a "colors 255 255 255" -s
# More useful commands.
ansible all -m setup
ansible all -a "free -m"
ansible all -m shell -a "ifconfig | grep inet" -s
ansible all -m user -a "name=pgibbons state=absent remove=yes" -s
ansible webservers -m service -a "name=nginx state=restarted" -s --forks=2
Download playbook examples
Playbooks
• Ad-Hoc commands don't solve the snowflake
problem
• "infrastructure as code"
• Simple YAML files
• Run with: ansible-playbook
Unique, by Pen Waggener
Playbooks
#!/bin/bash
# Shell script to install/configure Apache.
# Install Apache.
yum install --quiet -y httpd httpd-devel
# Copy configuration files.
cp /path/to/config/httpd.conf 
/etc/httpd/conf/httpd.conf
cp /path/to/config/httpd-vhosts.conf 
/etc/httpd/conf/httpd-vhosts.conf
# Start Apache.
service httpd start
# Set Apache to run on startup.
chkconfig httpd on
Playbooks
#!/bin/bash
# Shell script to install/configure Apache.
# Install Apache.
yum install --quiet -y httpd httpd-devel
# Copy configuration files.
cp /path/to/config/httpd.conf 
/etc/httpd/conf/httpd.conf
cp /path/to/config/httpd-vhosts.conf 
/etc/httpd/conf/httpd-vhosts.conf
# Start Apache.
service httpd start
# Set Apache to run on startup.
chkconfig httpd on
---
# Playbook to install/configure Apache.
hosts: all
tasks:
- name: Install Apache.
yum: name={{ item }} state=present
with_items:
- httpd
- httpd-devel
- name: Copy configuration files.
copy: "src={{ item.src }} dest={{ item.dest }}"
with_items:
- { src: "/path/to/config/httpd.conf",
dest: "/etc/httpd/conf/httpd.conf" }
- { src: "/path/to/config/httpd-vhosts.conf",
dest: "/etc/httpd/conf/httpd-vhosts.conf" }
- name: Ensure Apache is started and runs on startup.
service: name=httpd state=started enabled=yes
Demo
# Run just the users playbook.
ansible-playbook users.ml
# Run the users playbook again, to demonstrate idempotence.
ansible-playbook users.yml
# Run the web playbook (twice, again).
ansible-playbook web.yml
ansible-playbook web.yml
# Run the main playbook that includes users.yml and web.yml
ansible-playbook main.yml
ansible-playbook main.yml
Download playbook examples
Roles
• Like: Libraries, packages, config bundles
• Encapsulate configuration in smaller, reusable
chunks
• 4,000+ contributed roles on Ansible Galaxy
• To create: ansible-galaxy init [role-name]
Demo
Role folder structure:
rolename/
defaults/
main.yml <-- Most variables go here, so you can override if needed.
handlers/
main.yml
meta/
main.yml
tasks/
main.yml
tests/ <-- See Testing Ansible Roles with Travis CI on GitHub
vars/
main.yml <-- Special and static variables go here.
Download playbook examples
More Ansible
• Ansible Tower, Jenkins integration, CI
• Docker integration
• AWS, DigitalOcean, Rackspace, Softlayer, Linode, etc.
• Notifications
• Rolling updates
• Ansible Vault
• etc...
More Ansible
• Ansible Tower, Jenkins integration, CI
• Docker integration
• AWS, DigitalOcean, Rackspace, Softlayer, Linode, etc.
• Notifications
• Rolling updates
• Ansible Vault
• etc...
	
  ______________________________	
  
<	
  Follow	
  @AnsiBull	
  on	
  Twitter!	
  >	
  
	
  -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ^__^	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (oo)_______	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  (__)	
  	
  	
  	
  	
  	
  	
  )/	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ||-­‐-­‐-­‐-­‐w	
  |	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  ||	
  	
  	
  	
  	
  ||
More Resources
• Ansible documentation
• Ansible Vagrant examples
• Ansible for DevOps
• 50% off: http://bit.ly/ansible-stl
• Raspberry Pi Dramble
• Example playbook from this presentation
Ad

More Related Content

What's hot (20)

Network Automation with Ansible
Network Automation with AnsibleNetwork Automation with Ansible
Network Automation with Ansible
Anas
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
Jeff Geerling
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
Jeff Geerling
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
Dharmit Shah
 
Ansible Case Studies
Ansible Case StudiesAnsible Case Studies
Ansible Case Studies
Greg DeKoenigsberg
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPress
Alan Lok
 
Ansible and AWS
Ansible and AWSAnsible and AWS
Ansible and AWS
Peter Sankauskas
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
Peter Sankauskas
 
Network automation (NetDevOps) with Ansible
Network automation (NetDevOps) with AnsibleNetwork automation (NetDevOps) with Ansible
Network automation (NetDevOps) with Ansible
Bangladesh Network Operators Group
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
Dan Vaida
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Keith Resar
 
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
SlideTeam
 
Using Ansible at Scale to Manage a Public Cloud
Using Ansible at Scale to Manage a Public CloudUsing Ansible at Scale to Manage a Public Cloud
Using Ansible at Scale to Manage a Public Cloud
Jesse Keating
 
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Simplilearn
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
Karthik .P.R
 
Introduction to ansible galaxy
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxy
Ivan Serdyuk
 
Hands on ansible
Hands on ansibleHands on ansible
Hands on ansible
sumit23kumar
 
Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub Actions
Jeff Geerling
 
Ansible intro
Ansible introAnsible intro
Ansible intro
Marcelo Quintiliano da Silva
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
rmcleay
 
Network Automation with Ansible
Network Automation with AnsibleNetwork Automation with Ansible
Network Automation with Ansible
Anas
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
Jeff Geerling
 
Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2Ansible 2 and Ansible Galaxy 2
Ansible 2 and Ansible Galaxy 2
Jeff Geerling
 
Introduction to ansible
Introduction to ansibleIntroduction to ansible
Introduction to ansible
Dharmit Shah
 
Ansible + WordPress
Ansible + WordPressAnsible + WordPress
Ansible + WordPress
Alan Lok
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
Peter Sankauskas
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
Dan Vaida
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Keith Resar
 
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...Hands On Introduction To Ansible Configuration Management With Ansible Comple...
Hands On Introduction To Ansible Configuration Management With Ansible Comple...
SlideTeam
 
Using Ansible at Scale to Manage a Public Cloud
Using Ansible at Scale to Manage a Public CloudUsing Ansible at Scale to Manage a Public Cloud
Using Ansible at Scale to Manage a Public Cloud
Jesse Keating
 
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Simplilearn
 
Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
Karthik .P.R
 
Introduction to ansible galaxy
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxy
Ivan Serdyuk
 
Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub Actions
Jeff Geerling
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
rmcleay
 

Viewers also liked (11)

ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home
Jeff Geerling
 
Ansible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deploymentsAnsible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deployments
Jeff Geerling
 
Ansible 101
Ansible 101Ansible 101
Ansible 101
Gena Mykhailiuta
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
Arnaud LEMAIRE
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief Introduction
Jeff Geerling
 
Cyansible
CyansibleCyansible
Cyansible
Alan Norton
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
Martin Etmajer
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
jimi-c
 
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
Irakli Nadareishvili
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
bcoca
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
Robert Reiz
 
ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home ProTips for Staying Sane while Working from Home
ProTips for Staying Sane while Working from Home
Jeff Geerling
 
Ansible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deploymentsAnsible for Drupal infrastructure and deployments
Ansible for Drupal infrastructure and deployments
Jeff Geerling
 
DevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & AnsibleDevOps, A brief introduction to Vagrant & Ansible
DevOps, A brief introduction to Vagrant & Ansible
Arnaud LEMAIRE
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief Introduction
Jeff Geerling
 
Automated Deployments with Ansible
Automated Deployments with AnsibleAutomated Deployments with Ansible
Automated Deployments with Ansible
Martin Etmajer
 
V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
jimi-c
 
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
Irakli Nadareishvili
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
bcoca
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
Robert Reiz
 
Ad

Similar to Ansible 101 - Presentation at Ansible STL Meetup (20)

Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)
Richard Donkin
 
Ansible @ WebElement 2015
Ansible @ WebElement 2015Ansible @ WebElement 2015
Ansible @ WebElement 2015
Michal Maxian
 
Automating with Ansible
Automating with AnsibleAutomating with Ansible
Automating with Ansible
Ricardo Schmidt
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
 
No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
Jeff Potts
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
Richard Donkin
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
Khizer Naeem
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
DevOps Ltd.
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw
garrett honeycutt
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
Alex S
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
Bas Meijer
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUp
tylerturk
 
Ansible Devops North East - slides
Ansible Devops North East - slides Ansible Devops North East - slides
Ansible Devops North East - slides
InfinityPP
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done right
Dan Vaida
 
DevOps for database
DevOps for databaseDevOps for database
DevOps for database
Osama Mustafa
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Suresh Kumar
 
Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)Go Faster with Ansible (PHP meetup)
Go Faster with Ansible (PHP meetup)
Richard Donkin
 
Ansible @ WebElement 2015
Ansible @ WebElement 2015Ansible @ WebElement 2015
Ansible @ WebElement 2015
Michal Maxian
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
 
No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
Jeff Potts
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
Richard Donkin
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
Khizer Naeem
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
DevOps Ltd.
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw
garrett honeycutt
 
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015Ansible is the simplest way to automate. MoldCamp, 2015
Ansible is the simplest way to automate. MoldCamp, 2015
Alex S
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
Bas Meijer
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUp
tylerturk
 
Ansible Devops North East - slides
Ansible Devops North East - slides Ansible Devops North East - slides
Ansible Devops North East - slides
InfinityPP
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done right
Dan Vaida
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
Suresh Kumar
 
Ad

More from Jeff Geerling (12)

2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly
Jeff Geerling
 
There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)
Jeff Geerling
 
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi clusterEverything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Jeff Geerling
 
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 KeynoteReal World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Jeff Geerling
 
Make your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalableMake your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalable
Jeff Geerling
 
Ansible and Kubernetes
Ansible and KubernetesAnsible and Kubernetes
Ansible and Kubernetes
Jeff Geerling
 
HTTPS and Ansible
HTTPS and AnsibleHTTPS and Ansible
HTTPS and Ansible
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017
Jeff Geerling
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
Jeff Geerling
 
Florissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys RedevelopmentFlorissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys Redevelopment
Jeff Geerling
 
How to Build a Drupal Module
How to Build a Drupal ModuleHow to Build a Drupal Module
How to Build a Drupal Module
Jeff Geerling
 
2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly2020 Drupal Local Development Tools Survey - CMS Philly
2020 Drupal Local Development Tools Survey - CMS Philly
Jeff Geerling
 
There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)There's a role for that! (AnsibleFest 2019)
There's a role for that! (AnsibleFest 2019)
Jeff Geerling
 
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi clusterEverything I know about Kubernetes I learned from a Raspberry Pi cluster
Everything I know about Kubernetes I learned from a Raspberry Pi cluster
Jeff Geerling
 
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 KeynoteReal World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Real World DevOps - Jeff Geerling's NEDCamp 2018 Keynote
Jeff Geerling
 
Make your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalableMake your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalable
Jeff Geerling
 
Ansible and Kubernetes
Ansible and KubernetesAnsible and Kubernetes
Ansible and Kubernetes
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Drupal VM for Drupal 8 Dev - Drupal Camp STL 2017
Jeff Geerling
 
Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017Drupal VM for Drupal 8 Dev - MidCamp 2017
Drupal VM for Drupal 8 Dev - MidCamp 2017
Jeff Geerling
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
Jeff Geerling
 
Florissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys RedevelopmentFlorissant TIF - Cross Keys Redevelopment
Florissant TIF - Cross Keys Redevelopment
Jeff Geerling
 
How to Build a Drupal Module
How to Build a Drupal ModuleHow to Build a Drupal Module
How to Build a Drupal Module
Jeff Geerling
 

Recently uploaded (20)

Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025Adobe After Effects Crack FREE FRESH version 2025
Adobe After Effects Crack FREE FRESH version 2025
kashifyounis067
 
Adobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest VersionAdobe Illustrator Crack FREE Download 2025 Latest Version
Adobe Illustrator Crack FREE Download 2025 Latest Version
kashifyounis067
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdfMicrosoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
Microsoft AI Nonprofit Use Cases and Live Demo_2025.04.30.pdf
TechSoup
 
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025Why Orangescrum Is a Game Changer for Construction Companies in 2025
Why Orangescrum Is a Game Changer for Construction Companies in 2025
Orangescrum
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025Adobe Master Collection CC Crack Advance Version 2025
Adobe Master Collection CC Crack Advance Version 2025
kashifyounis067
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& ConsiderationsDesigning AI-Powered APIs on Azure: Best Practices& Considerations
Designing AI-Powered APIs on Azure: Best Practices& Considerations
Dinusha Kumarasiri
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Not So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java WebinarNot So Common Memory Leaks in Java Webinar
Not So Common Memory Leaks in Java Webinar
Tier1 app
 
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AIScaling GraphRAG:  Efficient Knowledge Retrieval for Enterprise AI
Scaling GraphRAG: Efficient Knowledge Retrieval for Enterprise AI
danshalev
 
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Exceptional Behaviors: How Frequently Are They Tested? (AST 2025)
Andre Hora
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025Adobe Lightroom Classic Crack FREE Latest link 2025
Adobe Lightroom Classic Crack FREE Latest link 2025
kashifyounis067
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 

Ansible 101 - Presentation at Ansible STL Meetup

  • 1. Ansible 101 Jeff Geerling Ansible St. Louis Meetup - July 8, 2015
  • 2. Who am I? • Jeff Geerling (geerlingguy) • Technical Architect, Acquia • Owner, Midwestern Mac LLC • Dev (mainly), Ops
  • 3. Ansible for DevOps • On LeanPub • Nearly complete! • 50% off: http://bit.ly/ansible-stl
  • 4. My Story • First 'real' server build: a 486 PC, RedHat Linux 6 Gateway 2000 4DX2-66v RedHat Linux 6.x
  • 5. Today Midwestern Mac Server Check.in Hosted Apache Solr Personal = 50+ prod servers,
 one very part-time sysadmin
  • 6. • “Configuration management for humans.” • Uses SSH • Secure, fast, simple • 300+ built-in modules • Don't need configuration management to manage your configuration management.
  • 7. • “Configuration management for humans.” • Uses SSH • Secure, fast, simple • 300+ built-in modules • Don't need configuration management to manage your configuration management.  ___________     <  And  cows!  >    -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐                        ^__^                        (oo)_______                          (__)              )/                                  ||-­‐-­‐-­‐-­‐w  |                                  ||          ||
  • 8. Installation • Python pip: sudo pip install ansible • Mac: brew install ansible • RHEL/CentOS/Fedora: sudo yum install ansible • Deb/Ubuntu:
 sudo apt-add-repository ppa:ansible/ansible
 sudo apt-get update
 sudo apt-get install ansible
  • 9. Ansible 101 1. Inventory: Describe your infrastructure 2. Ad-Hoc commands: Run one-off tasks 3. Playbooks: "Infrastructure as code" 4. Roles: Encapsulate configuration
  • 11. • 6-node Raspberry Pi cluster CPU 24 cores / 5.4 GHz RAM 6 GB Storage 96 GB microSD Network 10/100 over Gig https://github.com/geerlingguy/raspberry-pi-dramble The #Dramble
  • 13. • Check connectivity (always a good first step!)
 $ ansible all -m ping • Have fun with RGB LEDs!
 $ ansible webservers -a "rgb red" -s Ad-Hoc Commands
  • 14. • Check connectivity (always a good first step!)
 $ ansible all -m ping • Have fun with RGB LEDs!
 $ ansible webservers -a "rgb red" -s Ad-Hoc Commands  ________   <  Shiny!  >    -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐                        ^__^                        (oo)_______                          (__)              )/                                  ||-­‐-­‐-­‐-­‐w  |                                  ||          ||
  • 15. Demo # Test connectivity. ansible all -m ping # Raspberry Pi RGB LEDs. ansible all -a "rgb green" -s ansible all -a "rgb blue" -s --forks=1 ansible all -a "rgb green" -s --forks=2 ansible all -a "colors 255 255 255" -s # More useful commands. ansible all -m setup ansible all -a "free -m" ansible all -m shell -a "ifconfig | grep inet" -s ansible all -m user -a "name=pgibbons state=absent remove=yes" -s ansible webservers -m service -a "name=nginx state=restarted" -s --forks=2 Download playbook examples
  • 16. Playbooks • Ad-Hoc commands don't solve the snowflake problem • "infrastructure as code" • Simple YAML files • Run with: ansible-playbook Unique, by Pen Waggener
  • 17. Playbooks #!/bin/bash # Shell script to install/configure Apache. # Install Apache. yum install --quiet -y httpd httpd-devel # Copy configuration files. cp /path/to/config/httpd.conf /etc/httpd/conf/httpd.conf cp /path/to/config/httpd-vhosts.conf /etc/httpd/conf/httpd-vhosts.conf # Start Apache. service httpd start # Set Apache to run on startup. chkconfig httpd on
  • 18. Playbooks #!/bin/bash # Shell script to install/configure Apache. # Install Apache. yum install --quiet -y httpd httpd-devel # Copy configuration files. cp /path/to/config/httpd.conf /etc/httpd/conf/httpd.conf cp /path/to/config/httpd-vhosts.conf /etc/httpd/conf/httpd-vhosts.conf # Start Apache. service httpd start # Set Apache to run on startup. chkconfig httpd on --- # Playbook to install/configure Apache. hosts: all tasks: - name: Install Apache. yum: name={{ item }} state=present with_items: - httpd - httpd-devel - name: Copy configuration files. copy: "src={{ item.src }} dest={{ item.dest }}" with_items: - { src: "/path/to/config/httpd.conf", dest: "/etc/httpd/conf/httpd.conf" } - { src: "/path/to/config/httpd-vhosts.conf", dest: "/etc/httpd/conf/httpd-vhosts.conf" } - name: Ensure Apache is started and runs on startup. service: name=httpd state=started enabled=yes
  • 19. Demo # Run just the users playbook. ansible-playbook users.ml # Run the users playbook again, to demonstrate idempotence. ansible-playbook users.yml # Run the web playbook (twice, again). ansible-playbook web.yml ansible-playbook web.yml # Run the main playbook that includes users.yml and web.yml ansible-playbook main.yml ansible-playbook main.yml Download playbook examples
  • 20. Roles • Like: Libraries, packages, config bundles • Encapsulate configuration in smaller, reusable chunks • 4,000+ contributed roles on Ansible Galaxy • To create: ansible-galaxy init [role-name]
  • 21. Demo Role folder structure: rolename/ defaults/ main.yml <-- Most variables go here, so you can override if needed. handlers/ main.yml meta/ main.yml tasks/ main.yml tests/ <-- See Testing Ansible Roles with Travis CI on GitHub vars/ main.yml <-- Special and static variables go here. Download playbook examples
  • 22. More Ansible • Ansible Tower, Jenkins integration, CI • Docker integration • AWS, DigitalOcean, Rackspace, Softlayer, Linode, etc. • Notifications • Rolling updates • Ansible Vault • etc...
  • 23. More Ansible • Ansible Tower, Jenkins integration, CI • Docker integration • AWS, DigitalOcean, Rackspace, Softlayer, Linode, etc. • Notifications • Rolling updates • Ansible Vault • etc...  ______________________________   <  Follow  @AnsiBull  on  Twitter!  >    -­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐-­‐                        ^__^                        (oo)_______                          (__)              )/                                  ||-­‐-­‐-­‐-­‐w  |                                  ||          ||
  • 24. More Resources • Ansible documentation • Ansible Vagrant examples • Ansible for DevOps • 50% off: http://bit.ly/ansible-stl • Raspberry Pi Dramble • Example playbook from this presentation