ewypych.mysql-db-user

Ansible MySQL database and users Build Status

This role creates one or more MySQL databases and users with privileges for them.

Requirements

Requires the MySQLdb Python package on the remote host.

Role Variables

# vars/main.yml
databases:
  testingadb:
    name: testdb
    user: adm_test
    userhost: localhost
    password: "{{ db_pass_test }}"
  seconddb:
    name: seconddb
    user: adm_second
    userhost: localhost
    password: "{{ db_pass_second }}"

# vars/secure.yml
mysql_root_pass: rootpassword
db_pass_test: Mnbvcxz
db_pass_second: Zxcvbnm

You can Vault the secure.yml file.

There are some default variables stored in the defaults/main.yml file - you can change them to the your ones.

# defaults/main.yml
mysql_root: "root"
mysql_port: 3306

Example Playbook

    - hosts: all
      roles:
         - mysql-db-user

License

MIT

Author Information

Emil Wypych @gmail

About

Role creates databases and their users

Install
ansible-galaxy install ewypych.mysql-db-user
GitHub repository
License
mit
Downloads
108
Owner
Virtualizatio'n'Automation enthusiast, SysAdmin, Bear Lover