Professional Documents
Culture Documents
Vagrant and Ansible Training
Vagrant and Ansible Training
Vagrant and Ansible Training
ecosystem
Who am I?
S DevOps Enthusiast
S Using Ansible for over a year
S Love automation
S Love challenges
S 3 years in Telefnica R+D
Why Vagrant?
Vagrant setup
Vagrantfile
S Hosts and hardware specs
S OS to load from
S Port forwarding
S Ansible provision
Know more
Ansible components
S Ansible
S Ansible-playbook
S Ansible-vault
S Ansible galaxy
S Ansible Tower
Getting started
S Install ansible
S Get familiar with:
S YAML
S JINJA2
What is YAML?
S Everything in Ansible are files
S Most of them are YAML files
S YAML is simple to define structured data
array_example:
- value1
- value2
- value3
literal: value
hash_example:
key1: value1
key2: value2
key3: value3
Ansible.cfg
S Configuration settings
S Default behavior
S Global
Know more
Ansible adhoc
Know more
Ansible Facts
S Returns facts from hosts
S Set them as variables for Ansible
$ ansible 'db' -i enviro/vagrant/hosts -m setup -u vagrant
Know more
ansible-playbook
Know more
Inventory
$ cat /etc/ansible/hosts
S Within groups
S Host/group variables
S Group of groups
Know more
Dynamic inventory
Modules
Roles
Know more
Handlers
S Shortcuts called by tasks when changed
Templates
Jinja2 language
Know more
Tasks
Know more
Run playbooks
Vault
S Secure playbooks
S Useful for variables as
S Certificates
S Passwords
S Private keys
$ vim playbook.yml
$ ansible-vault encrypt playbook.yml
Vault password:
Confirm Vault password:
Encryption successful
$ echo password > secret.txt
$ ansible-playbook playbook-yml \
--vault-password-file=secret.txt
S Master password
S From file
S On demand
Know more
Plugins
Know more
Tower
S Licenced feature
S GUI framework
S User/group grants
S Playbook history
S Scheduled jobs
Q/A
source: inc.com