ansible-rookeries/tasks/mysql_db.yaml

16 lines
506 B
YAML

---
- name: setup MySQL server + Python dependencies
apt: pkg={{ item }} state=present
with_items:
- mysql-server
- python-mysqldb
when: rookeries_db.setup_db
- name: setup MySQL databases for rookeries.
mysql_db: name={{ rookeries_db.db_name }} state=present
when: rookeries_db.setup_db
- name: add MySQL database users for rookeries.
mysql_user: name={{ rookeries_db.username }} password={{ rookeries_db.password }} priv={{ rookeries_db.db_name }}:ALL
when: rookeries_db.setup_db