entercloudsuite.mysql

Ansible Role: mysql

Build Status Galaxy

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.

  1. Run molecule create to start a Docker container on your local machine.
  2. Use molecule login to access the running container.
  3. Edit the role files as needed.
  4. Add any other required roles in the molecule/default/requirements.yml file.
  5. Edit the molecule/default/playbook.yml file.
  6. Define tests under the molecule/default/tests folder.
  7. When you're ready, run molecule converge to execute the Ansible Playbook, and molecule verify to test it.
    Note that during the converge process, a syntax check of the role will be done.
    To stop the Docker container, use molecule 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.

Informazioni sul progetto

Playbook for mysql.

Installa
ansible-galaxy install entercloudsuite.mysql
Licenza
mit
Download
133.6k
Proprietario