2. About me
• Engineer
• Chief Software Engineer at Swivl
• Symfony Camp UA
Igor Brovchenko
igor.Brovchenko@gmail.com
@tigordev
3. What is Ansible?
• Ansible is an IT automation tool (Python)
• Free, open source (github)
• Simply
• Clear (anyone)
• Fast (to learn, setup)
• Complete (modules)
• Efficient (runs on OpenSSH)
• Secure (without agents)
4. Use cases
• Server provisioning
• Server orchestration
• Application deployment
• Continues Integration
• …
8. Control Machine Requirements
• Red Hat
• Debian
• CentOS
• OS X
• any of the BSDs
• Windows isn’t supported for the control
machine
• Ansible 1.8:Windows will be fully supported
Python 2.6
9. Managed Node Requirements
• Python 2.4
• Starting in version 1.7, Ansible contains support
for managing Windows machines
27. Cron module
# Ensure a job that runs at 2 and 5 exists.
# Creates an entry like "* 5,2 * * ls -alh > /dev/null"
- cron: name="check dirs" hour="5,2" job="ls -alh > /dev/null"
# Ensure an old job is no longer present. Removes any job that is prefixed
# by "#Ansible: an old job" from the crontab
- cron: name="an old job" state=absent
# Creates an entry like "@reboot /some/job.sh"
- cron: name="a job for reboot" special_time=reboot job="/some/job.sh"
# Creates a cron file under /etc/cron.d
- cron: name="yum autoupdate" weekday="2" minute=0 hour=12
user="root" job="YUMINTERACTIVE=0 /usr/sbin/yum-autoupdate"
cron_file=ansible_yum-autoupdate
# Removes a cron file from under /etc/cron.d
31. Templates
• Templates are processed by the Jinja2 templating
language (http://jinja.pocoo.org/docs/dev/templates/)
• Powerful conditionals
• Loops and iterators