ansible-role-nextcloud/tasks/database.yml
2020-12-03 14:52:14 +00:00

18 lines
645 B
YAML

---
- name: "Ensure nextcloud database exists"
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: "Ensure database user exists and has all privileges"
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 }}"