ansible-rookeries/tasks/mysql_db.yaml

19 lines
660 B
YAML
Raw Normal View History

---
- 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 login_host={{ rookeries_db.host }}
login_port={{ rookeries_db.port }}
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
login_host={{ rookeries_db.host }} login_port={{ rookeries_db.port }}
when: rookeries_db.setup_db