2. INTRODUCTION
• Simple automation tool
• Lightweight automation tool
• Execute one-time tasks
• Perform system administration tasks
• Configure servers and routers
• Gather information about devices
3. INTRODUCTION
• Written in Python
- easy to read and extend
• Open source
- source code on GitHub
• Easy to install and run
- get started in just a few minutes
4. INSTALL AND CONFIGURATION
• CentOS / Fedora
- enable the EPEL repository
- yum install ansible
• Ubuntu / Debian
- apt-add-repository ppa:ansible/ansible
- apt-get install ansible
• Any operating system
- create a virtualenv
- pip install ansible
6. AD-HOC COMMANDS
- Runs a command or call a module directly from
the command line, no Playbook required
ansible <inventory> <options>
ansible web –a /bin/date
ansible db -m ping
ansible web -m yum -a “name=nginx state=latest”
8. PLAYBOOKS
• Written in YAML
- human-readable
• Variable definitions
• Handlers
- take action upon changes
• Reusable
- save for the future, share with colleagues, etc
9. PLAYBOOKS
• How it works
- Playbook contain plays
- Plays contain tasks
- Tasks call module
- Tasks run sequentially
- Handlers are triggered by tasks
and run once, at the end plays
11. PLAYBOOKS
• Ansible uses the Jinja template engine
- variable substitution
- conditionals and loops (if, for)
- filters to transform text
• Templates are just text file
- text {{ ... }} undergoes variable substitution
- text {% ... %} marks conditionals and loops
- everything else is passed through
17. ANSIBLE-GALAXY
• Library for roles
- https://galaxy.ansible.com/list#/roles
- More than 11.000 roles
- Not always easy to find the best role!
ansible-galaxy install author.role
18. ANSIBLE OVIRT MODULES
ovirt_auth (E) - Manage authentication
ovirt_disks (E) - Manage VM and floating disks
ovirt_host_networks (E) - Manage host networks
ovirt_host_pm (E) - Manage power management
ovirt_hosts (E) - Manage hosts in oVirt
ovirt_hosts_facts (E) - Retrieve facts about one or
more oVirt hosts
ovirt_vms (E) - Module to manage VM