SlideShare a Scribd company logo
MANAGING MYSQL 
WITH ANSIBLE 
Ben Mildren 
04/11/14
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
What will we be covering today? 
1 What? 
What is 
Ansible? 
2 How? 
Usage and 
concepts 
3 Demo! 
Practical 
Examples 
3
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
Software solutions 
• Puppet: Apache license, www.puppetlabs.com 
– Ruby, Manifests (Puppet language) 
• Chef: Apache license, www.getchef.com 
– Ruby/Erlang, Cookbooks (Ruby) 
• Salt: Apache license, www.saltstack.com 
– Python, States (YAML/Jinja2 (default renderer)) 
• Ansible: GPL v3 license, www.ansible.com 
– Python, Playbooks (YAML/Jinja2) 
5 
http://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software
Why did we choose Ansible? 
• Simple, Readable 
• Declaritive, Idempotent 
• Uses SSH 
• Agentless 
6
Installation Requirements 
• Python 2.X 
– 2.6+ Control Machine 
● Required dependencies including; 
PyYAML, Jinja2, pycrypto, paramiko. 
– 2.4+ Managed Node 
● python-simplejson (if 2.5 or below) 
● libselinux-python (if selinux enabled) 
(and using copy/file/template functions) 
7 
http://docs.ansible.com/intro_installation.html
Installation 
• Package Manager 
– yum (via epel) 
– apt 
• pip 
• Source (https://github.com/ansible/ansible) 
https://github.com/ansible/ansible/blob/devel/CHANGELOG.md 
8 
http://docs.ansible.com/intro_installation.html
Configuration 
• Config file 
ANSIBLE_CONFIG > ./ansible.cfg > 
~/.ansible.cfg > /etc/ansible/ansible.cfg 
(settings are not merged) 
• Inventory file 
– /etc/ansible/hosts (default) 
– or can use dynamic inventory script 
https://github.com/ansible/ansible/tree/devel/plugins/inventory 
9
Inventory File 
• INI format 
– Hosts / Groups 
– Groups of Groups 
– Host and Group variables 
10
Inventory File 
• Example: 
[fra_cluster] 
mysql01 
mysql02 
[deu_cluster] 
mysql03 
mysql04 
[euro_clusters:children] 
fra_cluster 
deu_cluster 
11
Ad-Hoc Commands 
• ansible <host-pattern> [options] 
<host-pattern> → inventory file 
/etc/ansible/hosts (default) 
-i PATH, --inventory=PATH 
[options] 
typically module (-m) & arguments (-a) 
also connectivity, logging, etc 
12
Modules 
• ad-hoc default == command module 
• ansible-doc 
-l, --list 
-s, --snippet [module] 
[module] 
• can develop custom modules 
– Potentially any language, JSON output 
13 
http://docs.ansible.com/modules_by_category.html
Working with MySQL 
• MySQL Specific Modules 
– mysql_db 
– mysql_user 
– mysql_replication 
– mysql_variables 
14
Working with MySQL 
• Other useful modules 
– package manager (yum / apt) 
– service 
– file 
– template 
15
Templates 
• jinja2 formatted 
– variables, conditionals, loops, etc.. 
[mysqld] 
### General options 
user = mysql 
pid-file = {{ mysql_run_dir }}/mysqld.pid 
socket = {{ mysql_run_dir }}/mysqld.sock 
datadir = {{ mysql_data_dir }} 
tmpdir = {{ mysql_tmp_dir }} 
16 
http://jinja.pocoo.org/docs/dev/templates/
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
Enter the playbook! 
• conditionals 
• loops 
• async / poll 
• tags 
• error handling 
18
Facts 
• setup 
• will also run ohai and/or facter if installed 
• can be disabled for performance if not 
required 
• set_fact module 
19
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
Role play 
• Include files 
• Directory Structure 
• Dependencies & Defaults 
• ansible-galaxy 
– init 
– install, list, info, remove 
21
Logging 
• cowsay or nocows=1 
• verbose & verboser 
• ansible log 
• callback plugins 
– Notification (email, campfire, hipchat, etc) 
– improved logging (ELK anybody?) 
22 
https://github.com/ansible/ansible/tree/devel/plugins/callbacks
Password Management 
• lookup passwords 
• ansible-vault 
– create/edit/encrypt/decrypt/rekey 
– aes256 encryption 
ansible-playbook --ask-vault-pass 
ansible-playbook --vault-password-file 
(file or script) 
23
Performance 
• Connectivity 
– fireball (deprecated) 
– accelerated mode 
– pipelining 
• forking 
• ansible-pull? 
24
How can ansible help with MySQL? 
• Installation / Upgrades 
• Managing configuration (mysql & host) 
• User Administration 
• Managing cronjobs 
• Deployments 
• Provisioning new nodes in a cluster 
25
Demo & Questions 
• Pray to the demo gods.... 
• Questions? 
26

More Related Content

What's hot

Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
Marcus Deglos
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
Marcus Deglos
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backup
Saewoong Lee
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
Khizer Naeem
 
StackiFest16: Building a Cart
StackiFest16: Building a CartStackiFest16: Building a Cart
StackiFest16: Building a Cart
StackIQ
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setup
Mohammad_Tariq
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh things
Marcus Deglos
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra
StackIQ
 
MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527
Saewoong Lee
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz
StackIQ
 
Cobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningCobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioning
RUDDER
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
Kris Buytaert
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
Rayed Alrashed
 
Ansible for beginners
Ansible for beginnersAnsible for beginners
Ansible for beginners
Kuo-Le Mei
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karban
ansiblebrno
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
Žilvinas Kuusas
 
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg BrunoStackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackIQ
 
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackIQ
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
ViSenze - Artificial Intelligence for the Visual Web
 

What's hot (20)

Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2Drupal, varnish, esi - Toulouse November 2
Drupal, varnish, esi - Toulouse November 2
 
Speeding Up The Snail
Speeding Up The SnailSpeeding Up The Snail
Speeding Up The Snail
 
DATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backupDATABASE AUTOMATION with Thousands of database, monitoring and backup
DATABASE AUTOMATION with Thousands of database, monitoring and backup
 
Automation with ansible
Automation with ansibleAutomation with ansible
Automation with ansible
 
StackiFest16: Building a Cart
StackiFest16: Building a CartStackiFest16: Building a Cart
StackiFest16: Building a Cart
 
Hadoop single node setup
Hadoop single node setupHadoop single node setup
Hadoop single node setup
 
Performance all teh things
Performance all teh thingsPerformance all teh things
Performance all teh things
 
StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra StackiFest 16: Stacki Overview- Anoop Rajendra
StackiFest 16: Stacki Overview- Anoop Rajendra
 
MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527MySQL 5.7 innodb_enhance_partii_20160527
MySQL 5.7 innodb_enhance_partii_20160527
 
StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz StackiFest16: What's Next in Stacki - Mason Katz
StackiFest16: What's Next in Stacki - Mason Katz
 
Cobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioningCobbler - Fast and reliable multi-OS provisioning
Cobbler - Fast and reliable multi-OS provisioning
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Ansible for beginners
Ansible for beginnersAnsible for beginners
Ansible for beginners
 
Chef
ChefChef
Chef
 
Ansible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David KarbanAnsible Introduction - Ansible Brno #1 - David Karban
Ansible Introduction - Ansible Brno #1 - David Karban
 
Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)Using Capifony for Symfony apps deployment (updated)
Using Capifony for Symfony apps deployment (updated)
 
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg BrunoStackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
StackiFest16: How PayPal got a 300 Nodes up in 14 minutes - Greg Bruno
 
StackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg BrunoStackiFest16: Building a Cluster with Stacki - Greg Bruno
StackiFest16: Building a Cluster with Stacki - Greg Bruno
 
Cobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale EnvironmentsCobbler, Func and Puppet: Tools for Large Scale Environments
Cobbler, Func and Puppet: Tools for Large Scale Environments
 

Viewers also liked

U C2007 My S Q L Performance Cookbook
U C2007  My S Q L  Performance  CookbookU C2007  My S Q L  Performance  Cookbook
U C2007 My S Q L Performance Cookbookguestae36d0
 
Mysql administration
Mysql administrationMysql administration
Mysql administration
beben benzy
 
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux AdminThe Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
Dave Stokes
 
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's ToolchestMaking MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Lenz Grimmer
 
SAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL DevelopersSAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL Developers
saphanacookbook
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
Ronald Bradford
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
Morgan Tocker
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
Mydbops
 
Extended Essay
Extended EssayExtended Essay
Extended Essay
Phil Evans
 
Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013Saini Bakar
 
MySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema ImprovementsMySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema Improvements
Mark Leith
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and MonitoringMark Leith
 
Basics Of English Grammar 2 Ppt
Basics Of English Grammar 2 PptBasics Of English Grammar 2 Ppt
Basics Of English Grammar 2 Pptlaurajim21
 
A comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachersA comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachers
Jane Keeler
 
A comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvikA comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvik
Ivana Jovanovic
 

Viewers also liked (15)

U C2007 My S Q L Performance Cookbook
U C2007  My S Q L  Performance  CookbookU C2007  My S Q L  Performance  Cookbook
U C2007 My S Q L Performance Cookbook
 
Mysql administration
Mysql administrationMysql administration
Mysql administration
 
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux AdminThe Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
The Peoper Care and Feeding of a MySQL Server for Busy Linux Admin
 
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's ToolchestMaking MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
Making MySQL Administration a Breeze - A Look Into a MySQL DBA's Toolchest
 
SAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL DevelopersSAP HANA Cookbook for MySQL Developers
SAP HANA Cookbook for MySQL Developers
 
MySQL Monitoring 101
MySQL Monitoring 101MySQL Monitoring 101
MySQL Monitoring 101
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.Modern MySQL Monitoring and Dashboards.
Modern MySQL Monitoring and Dashboards.
 
Extended Essay
Extended EssayExtended Essay
Extended Essay
 
Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013Rancangan tahunan matematik tingkatan 5 2013
Rancangan tahunan matematik tingkatan 5 2013
 
MySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema ImprovementsMySQL 5.7: Performance Schema Improvements
MySQL 5.7: Performance Schema Improvements
 
MySQL Administration and Monitoring
MySQL Administration and MonitoringMySQL Administration and Monitoring
MySQL Administration and Monitoring
 
Basics Of English Grammar 2 Ppt
Basics Of English Grammar 2 PptBasics Of English Grammar 2 Ppt
Basics Of English Grammar 2 Ppt
 
A comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachersA comprehensive English grammar guide for EFL/ESL teachers
A comprehensive English grammar guide for EFL/ESL teachers
 
A comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvikA comprehensive grammar of the english language quirk greenbaum leech svartvik
A comprehensive grammar of the english language quirk greenbaum leech svartvik
 

Similar to Managing MySQL with Ansible

Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
Remote MySQL DBA
 
Ansible @ WebElement 2015
Ansible @ WebElement 2015Ansible @ WebElement 2015
Ansible @ WebElement 2015
Michal Maxian
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
Jeff Geerling
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUp
tylerturk
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
Alberto Molina Coballes
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
Bas Meijer
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
Luís Carneiro
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
laonap166
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
Nelson Calero
 
ansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and moreansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and more
Sabarinath Gnanasekar
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)Puppet
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł Rozlach
PROIDEA
 
PLNOG Automation@Brainly
PLNOG Automation@BrainlyPLNOG Automation@Brainly
PLNOG Automation@Brainly
vespian_256
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
Jeff Geerling
 
Configuration primer
Configuration primerConfiguration primer
Configuration primer
feanil
 
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsThe Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
Bill Malchisky Jr.
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
DevOps Ltd.
 
Package management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxPackage management and creation in Gentoo Linux
Package management and creation in Gentoo Linux
Donnie Berkholz
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable Infrastructure
Adrian Otto
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
Richard Donkin
 

Similar to Managing MySQL with Ansible (20)

Ansible for large scale deployment
Ansible for large scale deploymentAnsible for large scale deployment
Ansible for large scale deployment
 
Ansible @ WebElement 2015
Ansible @ WebElement 2015Ansible @ WebElement 2015
Ansible @ WebElement 2015
 
Ansible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL MeetupAnsible 101 - Presentation at Ansible STL Meetup
Ansible 101 - Presentation at Ansible STL Meetup
 
Introduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUpIntroduction to Ansible - Jan 28 - Austin MeetUp
Introduction to Ansible - Jan 28 - Austin MeetUp
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
 
Jenkins and ansible reference
Jenkins and ansible referenceJenkins and ansible reference
Jenkins and ansible reference
 
Collaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAsCollaborate 2012 - Administering MySQL for Oracle DBAs
Collaborate 2012 - Administering MySQL for Oracle DBAs
 
ansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and moreansible : Infrastructure automation,idempotent and more
ansible : Infrastructure automation,idempotent and more
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
 
PLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł RozlachPLNOG14: Automation at Brainly - Paweł Rozlach
PLNOG14: Automation at Brainly - Paweł Rozlach
 
PLNOG Automation@Brainly
PLNOG Automation@BrainlyPLNOG Automation@Brainly
PLNOG Automation@Brainly
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
 
Configuration primer
Configuration primerConfiguration primer
Configuration primer
 
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows AdminsThe Ultimate IBM and Lotus on Linux Workshop for Windows Admins
The Ultimate IBM and Lotus on Linux Workshop for Windows Admins
 
A tour of Ansible
A tour of AnsibleA tour of Ansible
A tour of Ansible
 
Package management and creation in Gentoo Linux
Package management and creation in Gentoo LinuxPackage management and creation in Gentoo Linux
Package management and creation in Gentoo Linux
 
Docker 102 - Immutable Infrastructure
Docker 102 - Immutable InfrastructureDocker 102 - Immutable Infrastructure
Docker 102 - Immutable Infrastructure
 
Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)Go Faster with Ansible (AWS meetup)
Go Faster with Ansible (AWS meetup)
 

Recently uploaded

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 

Managing MySQL with Ansible

  • 1. MANAGING MYSQL WITH ANSIBLE Ben Mildren 04/11/14
  • 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
  • 5. Software solutions • Puppet: Apache license, www.puppetlabs.com – Ruby, Manifests (Puppet language) • Chef: Apache license, www.getchef.com – Ruby/Erlang, Cookbooks (Ruby) • Salt: Apache license, www.saltstack.com – Python, States (YAML/Jinja2 (default renderer)) • Ansible: GPL v3 license, www.ansible.com – Python, Playbooks (YAML/Jinja2) 5 http://en.wikipedia.org/wiki/Comparison_of_open-source_configuration_management_software
  • 6. Why did we choose Ansible? • Simple, Readable • Declaritive, Idempotent • Uses SSH • Agentless 6
  • 7. Installation Requirements • Python 2.X – 2.6+ Control Machine ● Required dependencies including; PyYAML, Jinja2, pycrypto, paramiko. – 2.4+ Managed Node ● python-simplejson (if 2.5 or below) ● libselinux-python (if selinux enabled) (and using copy/file/template functions) 7 http://docs.ansible.com/intro_installation.html
  • 8. Installation • Package Manager – yum (via epel) – apt • pip • Source (https://github.com/ansible/ansible) https://github.com/ansible/ansible/blob/devel/CHANGELOG.md 8 http://docs.ansible.com/intro_installation.html
  • 9. Configuration • Config file ANSIBLE_CONFIG > ./ansible.cfg > ~/.ansible.cfg > /etc/ansible/ansible.cfg (settings are not merged) • Inventory file – /etc/ansible/hosts (default) – or can use dynamic inventory script https://github.com/ansible/ansible/tree/devel/plugins/inventory 9
  • 10. Inventory File • INI format – Hosts / Groups – Groups of Groups – Host and Group variables 10
  • 11. Inventory File • Example: [fra_cluster] mysql01 mysql02 [deu_cluster] mysql03 mysql04 [euro_clusters:children] fra_cluster deu_cluster 11
  • 12. Ad-Hoc Commands • ansible <host-pattern> [options] <host-pattern> → inventory file /etc/ansible/hosts (default) -i PATH, --inventory=PATH [options] typically module (-m) & arguments (-a) also connectivity, logging, etc 12
  • 13. Modules • ad-hoc default == command module • ansible-doc -l, --list -s, --snippet [module] [module] • can develop custom modules – Potentially any language, JSON output 13 http://docs.ansible.com/modules_by_category.html
  • 14. Working with MySQL • MySQL Specific Modules – mysql_db – mysql_user – mysql_replication – mysql_variables 14
  • 15. Working with MySQL • Other useful modules – package manager (yum / apt) – service – file – template 15
  • 16. Templates • jinja2 formatted – variables, conditionals, loops, etc.. [mysqld] ### General options user = mysql pid-file = {{ mysql_run_dir }}/mysqld.pid socket = {{ mysql_run_dir }}/mysqld.sock datadir = {{ mysql_data_dir }} tmpdir = {{ mysql_tmp_dir }} 16 http://jinja.pocoo.org/docs/dev/templates/
  • 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
  • 22. Logging • cowsay or nocows=1 • verbose & verboser • ansible log • callback plugins – Notification (email, campfire, hipchat, etc) – improved logging (ELK anybody?) 22 https://github.com/ansible/ansible/tree/devel/plugins/callbacks
  • 23. Password Management • lookup passwords • ansible-vault – create/edit/encrypt/decrypt/rekey – aes256 encryption ansible-playbook --ask-vault-pass ansible-playbook --vault-password-file (file or script) 23
  • 24. Performance • Connectivity – fireball (deprecated) – accelerated mode – pipelining • forking • ansible-pull? 24
  • 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
  • 26. Demo & Questions • Pray to the demo gods.... • Questions? 26