Create a MySQL environment with Docker (for Mac). Single server or a Master and multiple slaves.
See the presentation at: https://gitpitch.com/nethalo/ansible-mysql-docker#/
- ansible 2.3.2.0 (The version that comes with
brew install ansible
will do just fine) - Docker for Mac
- docker-py Python module
- pyyaml Python module
For the python modules, just run:
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
sudo pip install docker-py
sudo pip install pyyaml
Two main variables you need to know: "servers" and "mysql_image_version".
Servers is the amount of containers you wish to deploy, is an integrer value. mysql_image_version can have 2 options: 5.6 or 5.7.
The default values are: servers=1 and mysql_image_version=5.6
- hosts: all
gather_facts: False
roles:
- containers
There's just 1 role. To execute it, run a command as follow:
ansible-playbook site.yml -i hosts --extra-vars "servers=5 mysql_image_version=5.7"
In the above case, 1 Master and 4 Slaves will be deployed, using MySQL 5.7 (Percona images)
BSD
Daniel Guzman Burgos <daniel.guzman.burgos at percona.com>