Ansible code samples for my presentation
- Install Vagrant and run:
vagrant up
This will bring up three nodes to play with Ansible.
- Put your public SSH key to
vagrant/my.keys
:
cat ~/.ssh/id_rsa.pub > vagrant/my.keys
- Install Ansible
ansible
— basic features of playbooks. Commands:
ansible-playbook -i inventory playbook.yml
ansible-playbook -i inventory playbook-advanced.yml
ansible2
— basic templating. Command:
ansible-playbook -i inventory nginx.yml
ansible3
— multistage (production, staging) and more advanced templating. Commands:
ansible-playbook -i production sites.yml
ansible-playbook -i staging sites.yml