/ansible-tutorial

Ansible tutorial code samples for my presentation

Primary LanguageNginxMIT LicenseMIT

Ansible

Ansible code samples for my presentation

Presentation slides (RU)

Prereqs

  1. Install Vagrant and run:
vagrant up

This will bring up three nodes to play with Ansible.

  1. Put your public SSH key to vagrant/my.keys:
cat ~/.ssh/id_rsa.pub > vagrant/my.keys
  1. Install Ansible

Contents

  • 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