Skip to content

clouddrove/ansible-role-mysql

Repository files navigation

Ansible Role MySQL

This ansible role install mysql server for Debian.

Ansible Licence Distribution Distribution


We eat, drink, sleep and most importantly love DevOps. DevOps always promotes automation and standardisation. While setting up various environments like local, dev, testing, production, etc. it is critical to maintain the same environment across. This can easily be achieved using automating the environment setup & installation with the help of ansible-playbooks.

Smaller roles are created for each environment elements; which also include tasks & tests. These roles can then be grouped together in ansible-playbook to achieve the desired yet consistent results.

Prerequisites

This module has a few dependencies:

What Includes

Followiing things includes in this role:

  • mysql-server
  • python-selinux
  • python-mysqldb

Example Playbook

IMPORTANT: Since the master branch used in source varies based on new modifications, we suggest that you use the release versions here.

  - hosts: localhost
    remote_user: ubuntu
    become: true
    roles:
      - clouddrove.ansible_role_mysql

Variables

    mysql_db:
      - name: live-app
        collation: utf8_general_ci
        encoding: utf8

    mysql_users:
      - name: app_user
        pass: bSEs7K2v8Q5QvWuw
        priv: "*.*:ALL"
        host: "%"

    mysql_port: 3306
    mysql_bind_address: "0.0.0.0"
    mysql_root_db_pass: f9RRXh4r3JuxWbtZ3twWjjAVmBLtCPrb9v
    key_buffer_size: 16M
    max_allowed_packet: 16M
    query_cache_limit: 1M
    query_cache_size: 16M
    mysql_sql_mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
    mysql_conf_dir: "/etc/mysql/"
    mysql_user: mysql
    mysql_group: mysql

Installation

  $ ansible-galaxy install clouddrove.ansible_role_mysql

Feedback

If you come accross a bug or have any feedback, please log it in our issue tracker, or feel free to drop us an email at [email protected].

If you have found it worth your time, go ahead and give us a ★ on our GitHub!

About us

At CloudDrove, we offer expert guidance, implementation support and services to help organisations accelerate their journey to the cloud. Our services include docker and container orchestration, cloud migration and adoption, infrastructure automation, application modernisation and remediation, and performance engineering.

We are The Cloud Experts!


We ❤️ Open Source and you can check out our other modules to get help with your new Cloud ideas.