ansible-role-mariadb/tasks/main.yml
2019-11-01 16:09:55 +01:00

22 lines
603 B
YAML

---
- name: install mariadb
apt:
pkg:
- mariadb-server
- python-mysqldb
- python3-mysqldb
- name: create mariadb dbs
mysql_db:
name: "{{ item.key }}"
collation: "{{ item.value.collation | default('utf8_general_ci') }}"
encoding: "{{ item.value.encoding | default('utf8') }}"
with_dict: "{{ mariadb.dbs }}"
- name: create mariadb users
mysql_user:
name: "{{ item.key }}"
host: "{{ item.value.host | default('localhost') }}"
password: "{{ item.value.password }}"
priv: "{{ item.value.priv | default('*.*:USAGE') }}"
with_dict: "{{ mariadb.users }}"