Initial commit
This commit is contained in:
commit
ea4c2097d4
3 changed files with 36 additions and 0 deletions
22
tasks/main.yml
Normal file
22
tasks/main.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
- name: install mariadb
|
||||
apt:
|
||||
pkg: "{{ item }}"
|
||||
with_items:
|
||||
- mariadb-server
|
||||
- python-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 }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue