2. About me – Ben Mildren
• rDBA Technical Lead, Percona
– Percona Managed Services
• Around 15 years RDBMS experience
• Previous roles include:
– Team Technical Lead, Pythian
– Senior Database Administrator, Nokia
Email: ben.mildren@percona.com
LinkedIn: benmildren
Twitter: @productiondba
Slideshare: benmildren
2
3. What will we be covering today?
1 What?
What is
Ansible?
2 How?
Usage and
concepts
3 Demo!
Practical
Examples
3
4. What problem are we looking to solve?
4
Provisioning?
Configuration Management?
Application Deployment?
Orchestration?
Automation?
www.ansible.com/blog/2013/11/29/ansibles-architecture-beyond-configuration-management
17. Enter the playbook!
• Written in YAML
• Consists of one or more “plays”
– Target section
– Variable section
– Task section
– Handlers section
• Executed using ansible-playbook
17
18. Enter the playbook!
• conditionals
• loops
• async / poll
• tags
• error handling
18
19. Facts
• setup
• will also run ohai and/or facter if installed
• can be disabled for performance if not
required
• set_fact module
19
20. Running playbooks
• ansible-playbook playbook.yml
– similar connectivity options to ad-hoc ansible
command
– Has additional options specific to running
playbooks, e.g:
--list-hosts, --list-tasks
--syntax-check, --check (-C), --diff (-D)
--step, --start-at-task
--tags (-t), --skip-tags
20
21. Role play
• Include files
• Directory Structure
• Dependencies & Defaults
• ansible-galaxy
– init
– install, list, info, remove
21
25. How can ansible help with MySQL?
• Installation / Upgrades
• Managing configuration (mysql & host)
• User Administration
• Managing cronjobs
• Deployments
• Provisioning new nodes in a cluster
25