ewypych.mysql-db-user
Ansible MySQL database and users 
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
Author Information
Install
ansible-galaxy install ewypych.mysql-db-userLicense
mit
Downloads
108
Owner
Virtualizatio'n'Automation enthusiast, SysAdmin, Bear Lover
