The associated video is available: https://vimeo.com/107895274
Software configuration management tools are gaining ground everywhere. We've all probably at least heard of puppet, chef or salt by now, however there's a new rising star: Ansible. In this talk we'll learn about the way ansible approaches configuration management, software deployment, remote execution and other general IT tasks. We'll examine how to get up and running in a moment and how easy it is to manage multiple concurrent servers in parallel without needing additional daemons or bootstrapping! The talk will cover differences to puppet, chef etc and examine how to customise and extend Ansible with our favourite language.
Join us for this talk and you'll see why this award winning Python project has relevance for PHP and your work life through getting your servers under control.
This is a new talk about a relatively new configuration management system that is less complex to work with than puppet, chef, salt etc. but requires nothing extra on the machines being managed.
2. @magma_digital
Who am I?๏ Jeremy Coates, MD at Magma Digital Ltd
๏ Founder of PHPNW
๏ Manchester Digital Association Council
Member
๏ @phpcodemonkey
๏ linkedin.com/in/jeremycoates
11. @magma_digital
Sample Playbook
---
- hosts: localhost
user: root
vars:
motd_warning: 'WARNING: Use by ACME Employees ONLY'
tasks:
- name: setup a MOTD
copy: dest=/etc/motd content={{ motd_warning }}
12. @magma_digital
Playbooks๏ Language of playbooks relatively familiar to devs
๏ Targets - groups of tasks / vars etc.
๏ Vars - nice and obvious!
๏ Tasks - actions using modules / vars
๏ Includes - re-usable components
13. @magma_digital
Playbooks Speed
๏ Playbooks default to 5 forks
• -- forks <N> to vary this
๏ async: <seconds> for long running processes
๏ poll: <seconds> check the progress
๏ Tags: target sections of play books
๏ Roles: convention to enable reuse of playbooks
15. @magma_digital
Playbook Templates
๏ Jinja2 template engine. Has access to any ansible facts
(vars)
๏ Comments: {# a comment #}
๏ If/else: {% if 'authorativenames' in group_names %} {% else
%} {% endif %}
๏ Loops: {% for ip in ansible_all_ipv4_addresses %} {% end
for %}
16. @magma_digital
Modules๏ Over 100 modules already exist
• Swiss army knife of machine management: ansible-doc
๏ Write own modules in any language, including PHP
(json_encode)
๏ Module output key=value or JSON
17. @magma_digital
Ansible-pull
๏ Runs on the machine to be configured
๏ Larger deployments (auto-scaling server farms etc.)
๏ Auto-update when repo changes
๏ Requires cron
19. @magma_digital
Related?๏ ansible-vault - encryption for sensitive yaml files
๏ Ansible Guru - support subscription ($99/month)
๏ Ansible Tower (AWX) - commercial version
• Web console, REST API
• 50 machines from $2500/year (depending on support level
needed)
๏ Vagrant - Ansible provisioner module
21. @magma_digital
๏ Jeremy Coates, MD at Magma Digital Ltd
๏ Founder of PHPNW
๏ Manchester Digital Association Council Member
๏ @phpcodemonkey
๏ linkedin.com/in/jeremycoates
http://bit.ly/orchestrate_infrastructure
Simply Orchestratehttps://joind.in/11296