ansible-role-lstu/tasks/database.yml

29 lines
784 B
YAML
Raw Normal View History

2022-12-10 15:02:35 +01:00
---
- name: "database | Erstelle Datenbank"
ansible.builtin.mysql_db:
2022-12-14 17:17:59 +01:00
name: "{{ item }}"
2022-12-10 15:02:35 +01:00
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
2022-12-14 17:17:59 +01:00
loop:
- "{{ lstu_db }}"
- "{{ minion_db }}"
2022-12-10 15:02:35 +01:00
- name: "database | Erstelle Benuzter"
ansible.builtin.mysql_user:
2022-12-14 17:17:59 +01:00
name: "{{ item.user }}"
password: "{{ item.password }}"
2022-12-10 15:02:35 +01:00
host: "{{ inventory_hostname }}"
2022-12-14 17:17:59 +01:00
priv: "{{ item.database }}.*:ALL"
2022-12-10 15:02:35 +01:00
update_password: on_create
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
2022-12-14 17:17:59 +01:00
loop:
- user: "{{ lstu_db_user }}"
password: "{{ lstu_db_password }}"
database: "{{ lstu_db }}"
- user: "{{ minion_db_user }}"
password: "{{ minion_db_password }}"
database: "{{ minion_db }}"