ansible-role-dmarc-srg/tasks/database.yml
2023-08-16 20:41:30 +02:00

20 lines
612 B
YAML

---
- name: "Database | Crate database"
community.mysql.mysql_db:
name: "{{ dmarcsrg_database }}"
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
register: mariadb_created
delegate_to: "{{ database_host }}"
- name: "Database | Create database user"
community.mysql.mysql_user:
name: "{{ dmarcsrg_database }}"
password: "{{ dmarcsrg_database_password }}"
priv: "{{ dmarcsrg_database }}.*:ALL"
host: "{{ inventory_hostname }}"
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
delegate_to: "{{ database_host }}"