ansible-role-lstu/tasks/database.yml

28 lines
784 B
YAML

---
- name: "database | Erstelle Datenbank"
ansible.builtin.mysql_db:
name: "{{ item }}"
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
loop:
- "{{ lstu_db }}"
- "{{ minion_db }}"
- name: "database | Erstelle Benuzter"
ansible.builtin.mysql_user:
name: "{{ item.user }}"
password: "{{ item.password }}"
host: "{{ inventory_hostname }}"
priv: "{{ item.database }}.*:ALL"
update_password: on_create
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
loop:
- user: "{{ lstu_db_user }}"
password: "{{ lstu_db_password }}"
database: "{{ lstu_db }}"
- user: "{{ minion_db_user }}"
password: "{{ minion_db_password }}"
database: "{{ minion_db }}"