SlideShare a Scribd company logo
Ansible 202
(because i hate odd numbers)
$whoami
● DevOps Engineer @ Jampp
● Whisky enthusiast
● Amateur golfer
● Nardoz’s newbie
@sebamontini
What is Ansible?
Ansible is a very simple (yet powerful) automation engine.
● Simple: Ansible uses a clear (readable) YAML sintax.
● Fast: easy to learn, easy to setup.
● Efficient: No agent on you servers.
● Secure: No open ports on your firewalls (SSH).
@sebamontini
Glosary
Inventory: Lists of Hosts, Variables and Groups.
Modules: The units of work that Ansible ships out to remote
hosts.
Facts: Things that are discovered about remote nodes.
Playbooks: List of plays (mapping of hosts and tasks).
Tasks: set of actions (module+args) to be executed.
@sebamontini
Tags
@sebamontini
---
tasks:
- yum: name={{ item }} state=installed
with_items:
- httpd
- memcached
tags:
- packages
- template: src=templates/src.j2 dest=/etc/foo.conf
tags:
- config
- deploy
$ansible-playbook myapp.yml --tags config,deploy
Roles
@sebamontini
roles/
myRole/ # this hierarchy represents a "role"
tasks/ #
main.yml # <-- tasks file can include smaller files if warranted
handlers/ #
main.yml # <-- handlers file
templates/ # <-- files for use with the template resource
ntp.conf.j2 # <------- templates end in .j2
files/ #
bar.txt # <-- files for use with the copy resource
foo.sh # <-- script files for use with the script resource
vars/ #
main.yml # <-- variables associated with this role
defaults/ #
main.yml # <-- default lower priority variables for this role
meta/ #
main.yml # <-- role dependencies
Ansible Galaxy
@sebamontini
$ansible-galaxy install -r requirements.yml
---
- src: torian.python
name: python
path: roles-galaxy/
version: 1.0.0
- src: bennojoy.memcached
name: memcached
path: roles-galaxy
- src: https://github.com/torian/ansible-role-phantomjs
name: phantomjs
path: roles-galaxy/
ansible.cfg
[defaults]
inventory = inventory/ec2.py
roles_path = roles:roles-galaxy
retry_files_enabled = True
retry_files_save_path = .ansible-retry
$ansible-playbook <playbook.yml> -l @<playbook>.retry
@sebamontini
ansible-vault
Vault is a feature of ansible that allows keeping sensitive
data such as passwords or keys in encrypted files.
roles/aliens
├── tasks
│ └── main.yml
└── vars
└── spoilers.yml
$ ansible-playbook playbooks/movies.yml --vault-password-file ~/.vault_pass.txt
@sebamontini
---
- include_vars: spoilers.yml
- name: Put the spoiler in the tmp directory.
copy:
content="{{spoiler_text}}"
dest=/tmp/spoiler_text.txt
$ ansible-vault encrypt roles/aliens/vars/spoilers.yml
--vault-password-file ~/.vault_pass.txt
$cat playbooks/movies.yml
---
- hosts: all
roles:
- { role: aliens }
We’re hiring !
http://jampp.com/jobs.php
@sebamontini
Thanks
sebastian@jampp.com
@sebamontini
github.com/sebamontini

More Related Content

PDF
Ansible 202 - sysarmy
PDF
V2 and beyond
PDF
Development of Ansible modules
PDF
AnsibleFest 2014 - Role Tips and Tricks
PDF
Ansible for beginners ...?
PDF
Hacking ansible
PDF
Ansible leveraging 2.0
PDF
Ansible - Swiss Army Knife Orchestration
Ansible 202 - sysarmy
V2 and beyond
Development of Ansible modules
AnsibleFest 2014 - Role Tips and Tricks
Ansible for beginners ...?
Hacking ansible
Ansible leveraging 2.0
Ansible - Swiss Army Knife Orchestration

What's hot (20)

PDF
More tips n tricks
PDF
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
PDF
Ansible tips & tricks
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud
PDF
Ansible 2.0
PDF
Automating with ansible (Part B)
PPTX
DevOps with Fabric
PDF
Ansible
KEY
Wider than rails
PDF
Go初心者がGoでコマンドラインツールの作成に挑戦した話
PPTX
Deployment with Fabric
ODP
Europython 2011 - Playing tasks with Django & Celery
PDF
Deploying Rails Applications with Capistrano
PDF
Templating in ansible
PDF
CouchDB: A NoSQL database
PDF
Ansible Callback Plugins
PDF
Lightweight Webservices with Sinatra and RestClient
PDF
Testing your infrastructure with litmus
PDF
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
PDF
Fabric - a server management tool from Instagram
More tips n tricks
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Ansible tips & tricks
fog or: How I Learned to Stop Worrying and Love the Cloud
Ansible 2.0
Automating with ansible (Part B)
DevOps with Fabric
Ansible
Wider than rails
Go初心者がGoでコマンドラインツールの作成に挑戦した話
Deployment with Fabric
Europython 2011 - Playing tasks with Django & Celery
Deploying Rails Applications with Capistrano
Templating in ansible
CouchDB: A NoSQL database
Ansible Callback Plugins
Lightweight Webservices with Sinatra and RestClient
Testing your infrastructure with litmus
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
Fabric - a server management tool from Instagram
Ad

Viewers also liked (10)

PDF
Ansible - A 'crowd' introduction
PDF
Ansible + WordPress
PPTX
Jupyterで運用やってみた
PDF
DevOps for Humans - Ansible for Drupal Deployment Victory!
PDF
Ansible
PDF
Ansibleで始めるインフラ構築自動化
PDF
Ansibleの現在とこれから
PPTX
Automated Deployments with Ansible
PPTX
Ansible: How to Get More Sleep and Require Less Coffee
PDF
Ansible Introduction
Ansible - A 'crowd' introduction
Ansible + WordPress
Jupyterで運用やってみた
DevOps for Humans - Ansible for Drupal Deployment Victory!
Ansible
Ansibleで始めるインフラ構築自動化
Ansibleの現在とこれから
Automated Deployments with Ansible
Ansible: How to Get More Sleep and Require Less Coffee
Ansible Introduction
Ad

Similar to Ansible 202 (20)

PDF
Ansible not only for Dummies
PDF
Installing AtoM with Ansible
PDF
A tour of Ansible
PDF
#OktoCampus - Workshop : An introduction to Ansible
PDF
Getting Started with Ansible - Jake.pdf
PPTX
Introduction to Ansible - (dev ops for people who hate devops)
PPTX
Introduction to ansible
PPTX
Ansible Devops North East - slides
PPTX
SESSION Ansible how to deploy and push resources
PPTX
Automating with ansible (Part A)
ODP
ansible why ?
PPTX
Introduction to Ansible - Peter Halligan
PPTX
Deploying Symfony2 app with Ansible
PDF
Ansible with oci
PDF
Ansible
PDF
Ansible automation tool with modules
PPTX
Configuration primer
PDF
Ansible at work
PDF
PLNOG14: Automation at Brainly - Paweł Rozlach
Ansible not only for Dummies
Installing AtoM with Ansible
A tour of Ansible
#OktoCampus - Workshop : An introduction to Ansible
Getting Started with Ansible - Jake.pdf
Introduction to Ansible - (dev ops for people who hate devops)
Introduction to ansible
Ansible Devops North East - slides
SESSION Ansible how to deploy and push resources
Automating with ansible (Part A)
ansible why ?
Introduction to Ansible - Peter Halligan
Deploying Symfony2 app with Ansible
Ansible with oci
Ansible
Ansible automation tool with modules
Configuration primer
Ansible at work
PLNOG14: Automation at Brainly - Paweł Rozlach

More from Sebastian Montini (13)

PPTX
Not all that glitter is AWS - Nerdearla2016
PDF
Designed to fail
PPTX
Devopsconf 2015 sebamontini
PPTX
Startup Weekend 2015
PDF
Aws meetup (sep 2015) exprimir cada centavo
PPTX
AWS Anti patterns
PPTX
ARC202:real world real time analytics
PDF
Mentalidad Alternativa 08
PDF
PDF
PDF
Debian vs. Ubuntu
PDF
software libre al servicio de la educacion
PDF
gnu/linux: la libertad a un paso de distancia
Not all that glitter is AWS - Nerdearla2016
Designed to fail
Devopsconf 2015 sebamontini
Startup Weekend 2015
Aws meetup (sep 2015) exprimir cada centavo
AWS Anti patterns
ARC202:real world real time analytics
Mentalidad Alternativa 08
Debian vs. Ubuntu
software libre al servicio de la educacion
gnu/linux: la libertad a un paso de distancia

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PDF
KodekX | Application Modernization Development
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation theory and applications.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation theory and applications.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm

Ansible 202

  • 1. Ansible 202 (because i hate odd numbers)
  • 2. $whoami ● DevOps Engineer @ Jampp ● Whisky enthusiast ● Amateur golfer ● Nardoz’s newbie @sebamontini
  • 3. What is Ansible? Ansible is a very simple (yet powerful) automation engine. ● Simple: Ansible uses a clear (readable) YAML sintax. ● Fast: easy to learn, easy to setup. ● Efficient: No agent on you servers. ● Secure: No open ports on your firewalls (SSH). @sebamontini
  • 4. Glosary Inventory: Lists of Hosts, Variables and Groups. Modules: The units of work that Ansible ships out to remote hosts. Facts: Things that are discovered about remote nodes. Playbooks: List of plays (mapping of hosts and tasks). Tasks: set of actions (module+args) to be executed. @sebamontini
  • 5. Tags @sebamontini --- tasks: - yum: name={{ item }} state=installed with_items: - httpd - memcached tags: - packages - template: src=templates/src.j2 dest=/etc/foo.conf tags: - config - deploy $ansible-playbook myapp.yml --tags config,deploy
  • 6. Roles @sebamontini roles/ myRole/ # this hierarchy represents a "role" tasks/ # main.yml # <-- tasks file can include smaller files if warranted handlers/ # main.yml # <-- handlers file templates/ # <-- files for use with the template resource ntp.conf.j2 # <------- templates end in .j2 files/ # bar.txt # <-- files for use with the copy resource foo.sh # <-- script files for use with the script resource vars/ # main.yml # <-- variables associated with this role defaults/ # main.yml # <-- default lower priority variables for this role meta/ # main.yml # <-- role dependencies
  • 7. Ansible Galaxy @sebamontini $ansible-galaxy install -r requirements.yml --- - src: torian.python name: python path: roles-galaxy/ version: 1.0.0 - src: bennojoy.memcached name: memcached path: roles-galaxy - src: https://github.com/torian/ansible-role-phantomjs name: phantomjs path: roles-galaxy/
  • 8. ansible.cfg [defaults] inventory = inventory/ec2.py roles_path = roles:roles-galaxy retry_files_enabled = True retry_files_save_path = .ansible-retry $ansible-playbook <playbook.yml> -l @<playbook>.retry @sebamontini
  • 9. ansible-vault Vault is a feature of ansible that allows keeping sensitive data such as passwords or keys in encrypted files. roles/aliens ├── tasks │ └── main.yml └── vars └── spoilers.yml $ ansible-playbook playbooks/movies.yml --vault-password-file ~/.vault_pass.txt @sebamontini --- - include_vars: spoilers.yml - name: Put the spoiler in the tmp directory. copy: content="{{spoiler_text}}" dest=/tmp/spoiler_text.txt $ ansible-vault encrypt roles/aliens/vars/spoilers.yml --vault-password-file ~/.vault_pass.txt $cat playbooks/movies.yml --- - hosts: all roles: - { role: aliens }