ansible-role-nextcloud/tasks/database.yml

21 lines
622 B
YAML

---
- name: "Datenbank einrichten"
mysql_db:
name: "{{ database }}"
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
config_file: /etc/mysql/debian.cnf
delegate_to: "{{ database_host }}"
- name: "Datenbank Benutzer einrichten"
mysql_user:
name: "{{ database }}"
host: "{{ inventory_hostname }}"
password: "{{ lookup('password', '/tmp/nc_db_password chars=ascii_letters') }}"
priv: "{{ database }}.*:ALL"
state: present
login_unix_socket: "{{ mysql_socket }}"
login_user: root
update_password: on_create
delegate_to: "{{ database_host }}"