Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ansible Vancouver Kickoff Meetup

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Ansible Vancouver Kickoff Meetup

Avatar for Stephen Granger

Stephen Granger

August 25, 2017
Tweet

Other Decks in Technology

Transcript

  1. Welcome! About me • News • Bugs • Ad-hoc, Playbooks,

    Inventories and Roles • Best practices, inventories, Roles, variables and playbooks • Proposal 7 • Q&A
  2. News Ansiblefest San Francisco 2017, September 7 • https://www.ansible.com/ansiblefest •

    Schedule is up • Ansible + Serverless Technologies ◦ Ryan Brown, Senior Software Engineer, Ansible by Red Hat • Managing Windows Desktops with Ansible ◦ Dag Wieers, Freelance Automation Engineer
  3. News Ansible 2.4 is Coming!! https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/roadmap/ROADMAP_2_4.rst • name: for blocks

    • Python3 support (http://docs.ansible.com/ansible/latest/python_3_support.html) • Kubernetes (ansible/ansible-kubernetes-modules) • Ansible-vault, multiple passwords
  4. Adhoc ansible -m setup ansible -m shell -a “grep jenkins

    /etc/passwd” webservers -f 30 -b -K
  5. Playbooks • http://docs.ansible.com/ansible/latest/playbooks_intro.html#playbook-lan guage-example https://www.ansible.com/blog/getting-started-writing-your-first-playbook • Become (http://docs.ansible.com/ansible/latest/become.html) -b ◦

    Become_user ◦ Become_method ◦ -K • Blocks, http://docs.ansible.com/ansible/latest/playbooks_blocks.html • Loops, conditionals, meta, handlers, strategies, async, debugger, check mode, delegation, prompts, start and step, lookups
  6. Can’t forget Variables • http://docs.ansible.com/ansible/latest/playbooks_variables.html#variable s • Hierarchy/precedence of variables

    Static Groups of Dynamic Groups • http://docs.ansible.com/ansible/latest/intro_dynamic_inventory.html#static-groups-of-dynamic-groups
  7. Best Practices (http://docs.ansible.com/ansible/latest/playbooks_best_practices.html) • Directory layout • “You absolutely should

    be using roles. Roles are great. Use roles. Roles! Did we say that enough? Roles are great” • Staging Vs Production • Vault for secrets (now supports multiple passwords) • Top level Playbooks are separated by Role • https://openedx.atlassian.net/wiki/spaces/OpenOPS/pages/26837527/Ansible+Code+Conventions
  8. Best Practices, more on Roles • Keep it simple (https://www.ansible.com/ansible-roles-by-acquia)

    https://github.com/geerlingguy/ansible-role-nginx Vs https://github.com/telusdigital/ansible-nginx https://github.com/andrewrothstein/ansible-redis
  9. You absolutely should be using roles. Roles are great. Use

    roles. Roles! Did we say that enough? Roles are great • Ansible Galaxy, YMMV • ansible-galaxy init my-role • ansible-galaxy install -r requirements.yml ◦ http://docs.ansible.com/ansible/latest/galaxy.html#installing-multiple-roles-from-a-file