Automation Made Simple with Ansible

Automation Made Simple with Ansible

Short talk presented at the first DigitalOcean Berlin meetup

719435d98d452de7ac367c828266cf01?s=128

Erika Heidi

April 20, 2016
Tweet

Transcript

  1. None
  2. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    ANSIBLE OVERVIEW
  3. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Ansible • Simple and straightforward language (YAML) • Agentless Architecture • Huge collection of built-in modules • Great community, very popular on Github
  4. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Inventories #/etc/ansible/hosts [dev] 192.168.30.33 [prod] myserver.com otherserver.com
  5. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook Example --- - hosts: all become: true tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Nginx apt: name=nginx state=latest
  6. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook Resources • Variables • Loops • Conditionals • Templates • Ansible Vault
  7. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    HANDS ON
  8. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook --- - hosts: all become: true vars: packages: ["nginx", "vim"] message: "1st DigitalOcean Berlin Meetup, YAY!" tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Packages apt: name={{ item }} state=latest with_items: packages - name: Change Nginx index file template: src=index.tpl dest=/usr/share/nginx/html/index.html notify: restart nginx handlers: - name: restart nginx service: name=nginx enabled=yes state=restarted
  9. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook --- - hosts: all become: true vars: packages: ["nginx", "vim"] message: "1st DigitalOcean Berlin Meetup, YAY!" tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Packages apt: name={{ item }} state=latest with_items: packages - name: Change Nginx index file template: src=index.tpl dest=/usr/share/nginx/html/index.html notify: restart nginx handlers: - name: restart nginx service: name=nginx enabled=yes state=restarted
  10. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook --- - hosts: all become: true vars: packages: ["nginx", "vim"] message: "1st DigitalOcean Berlin Meetup, YAY!" tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Packages apt: name={{ item }} state=latest with_items: packages - name: Change Nginx index file template: src=index.tpl dest=/usr/share/nginx/html/index.html notify: restart nginx handlers: - name: restart nginx service: name=nginx enabled=yes state=restarted
  11. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook --- - hosts: all become: true vars: packages: ["nginx", "vim"] message: "1st DigitalOcean Berlin Meetup, YAY!" tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Packages apt: name={{ item }} state=latest with_items: packages - name: Change Nginx index file template: src=index.tpl dest=/usr/share/nginx/html/index.html notify: restart nginx handlers: - name: restart nginx service: name=nginx enabled=yes state=restarted
  12. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook --- - hosts: all become: true vars: packages: ["nginx", "vim"] message: "1st DigitalOcean Berlin Meetup, YAY!" tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Packages apt: name={{ item }} state=latest with_items: packages - name: Change Nginx index file template: src=index.tpl dest=/usr/share/nginx/html/index.html notify: restart nginx handlers: - name: restart nginx service: name=nginx enabled=yes state=restarted
  13. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    Playbook --- - hosts: all become: true vars: packages: ["nginx", "vim"] message: "1st DigitalOcean Berlin Meetup, YAY!" tasks: - name: Update apt-cache apt: update_cache=yes - name: Install Packages apt: name={{ item }} state=latest with_items: packages - name: Change Nginx index file template: src=index.tpl dest=/usr/share/nginx/html/index.html notify: restart nginx handlers: - name: restart nginx service: name=nginx enabled=yes state=restarted
  14. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    DEMO TIME!
  15. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    QUESTIONS?
  16. Automation Made Simple with Ansible @erikaheidi / DigitalOcean Meetup Berlin

    THANKS! @erikaheidi erika@do.co