Ansible playbook for installing MySQL Server on CentOS/Debian Linux
Install this playbook:
ansible-galaxy install jeffhung.mysql
Configure the password for mysql root account.
List the databases to create. For example, the following configuration creates
two databases: foo_db
and bar_db
.
mysql_databases:
- name: foo_db
- name: bar_db
List other non-root mysql accounts to create. For example, the following
configuration creates two accounts: foo_user
and bar_user
, which could
access foo_db
and bar_db
respectively.
mysql_users:
- name: foo_user
pass: y2TtnA5n
priv: "foo_db.*:ALL"
- name: bar_user
pass: fGyvNb2s
priv: "bar_db.*:ALL"
BSD