ansible-role-nextcloud/tasks/database.yml

17 lines
612 B
YAML

---
- name: "Datenbank einrichten"
mysql_db:
name: '{{ nextcloud_mysql_db }}'
state: present
config_file: /etc/mysql/debian.cnf
delegate_to: "{{ nextcloud_database_host }}"
# Todo: Formatierung des Nutzernamens und Zuordnung des hosts schlaegt fehl
- name: "Datenbank Benutzer einrichten"
mysql_user:
name: "{{ nextcloud_mysql_user }}"
password: "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}"
priv: "{{ nextcloud_mysql_db }}.{{ inventory_hostname }}:ALL"
state: present
config_file: /etc/mysql/debian.cnf
delegate_to: "{{ nextcloud_database_host }}"