Prabin111/mysql_role

Ansible role to install MySQL Community Server

★ 0Forks 0GitHub ↗Compare

README

Logo

MySQL Ansible role

Build Status Ansible Galaxy

This ansible role installs a Prometheus Node Exporter in a debian environment.

Getting Started

These instructions will get you a copy of the role for your Ansible playbook. Once launched, it will install an MySQL Database in a Debian system.

Prerequisities

Ansible 2.4.3.0 version installed. Inventory destination should be a Debian environment.

For testing purposes, Molecule with Docker as driver and Goss as verifier.

Installing

Create or add to your roles dependency file (e.g requirements.yml):

- src: idealista.mysql_role
  version: 1.0.0
  name: mysql

Install the role with ansible-galaxy command:

ansible-galaxy install -p roles -r requirements.yml -f

Use in a playbook:

---
- hosts: someserver
  roles:
    - role: mysql

Usage

Installation tasks follows the install guide: https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/

Look to the defaults properties file to see the possible configuration properties.

Set at least mysql_root_user and mysql_root_password:

mysql_root_user: mysql         # Change mysql root user
mysql_root_password: secret    # Change mysql root password

Add any number of databases and create users with privs on them

mysql_databases:
   - name: example_DB
     encoding: utf8
   - name: anotherExample_DB

mysql_users:
   - name: admin_user
     host: 127.0.0.1
     password: secret
     priv: [ *.*:USAGE ]
   - name: example_user
     host: *
     password: secret
     priv: [ example_DB.*:ALL ]

Testing

$ pipenv install -r test-requirements.txt -python 2.7

To check the installation

$ pipenv run molecule converge
$ pipenv run molecule login

vagrant@mysql:~$ mysql -u root -ptesting

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| mysql_test         |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)

Built With

Ansible Molecule Goss

Versioning

For the versions available, see the tags on this repository.

Additionaly you can see what change in each version in the CHANGELOG.md file.

Authors

See also the list of contributors who participated in this project.

License

Apache 2.0 License

This project is licensed under the Apache 2.0 license - see the LICENSE file for details.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Contributors

dortegaujmonterrubiovideRustyBower

Issues