entercloudsuite.mysql
Ansible Role: mysql
This role installs MySQL on Ubuntu 16.04 (Xenial).
Requirements
You need Ansible version 2.4 or higher to use this role.
Role Variables
Most of the variables for this role are found in defaults/main.yml.
Example Playbook
To run with the default variables:
- name: install percona mysql
hosts: all
pre_tasks:
- name: install curl
package: name=curl
- name: install percona mysql repo
shell: curl -O https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb && dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
args:
creates: /etc/apt/sources.list.d/percona-release.list
executable: /bin/bash
chdir: /tmp
roles:
- role: entercloudsuite.mysql
mysql_packages:
- percona-server-server-5.7
Testing
Tests are done using Molecule.
To get started, install Molecule or use docker-compose run --rm molecule to run a local Docker container from the entercloudsuite/molecule project.
- Run
molecule createto start a Docker container on your local machine. - Use
molecule loginto access the running container. - Edit the role files as needed.
- Add any other required roles in the molecule/default/requirements.yml file.
- Edit the molecule/default/playbook.yml file.
- Define tests under the molecule/default/tests folder.
- When you're ready, run
molecule convergeto execute the Ansible Playbook, andmolecule verifyto test it.
Note that during the converge process, a syntax check of the role will be done.
To stop the Docker container, usemolecule destroy.
To run all the steps in one command, use molecule test.
To run the role on a VM, use the playbook_deploy.yml file with the command: ansible-playbook ansible-mysql/molecule/default/playbook_deploy.yml -i VM_IP_OR_FQDN, -u ubuntu --private-key private.pem.
License
This project is licensed under the MIT license.
Installa
ansible-galaxy install entercloudsuite.mysqlLicenza
mit
Download
133.6k
Proprietario
