From e13a190aaab8a260b28d5f6447d6faf1ffd88bec Mon Sep 17 00:00:00 2001 From: phil Date: Sun, 31 Jan 2021 02:00:26 +0000 Subject: [PATCH] Init der Wordpress-Rolle --- defaults/main.yml | 1 + tasks/database.yml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b547e32..a9a02ee 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -7,6 +7,7 @@ nextcloud_admin_pw: admin nextcloud_database_host: database.kahlo nextcloud_dl_url: https://download.nextcloud.com/server/releases nextcloud_gateway: kahlo.kahlo +nextcloud_host: sl-nextcloud.kahlo nextcloud_mysql_db: "nc_{{ common_name }}" nextcloud_mysql_pw: admin nextcloud_mysql_user: "nc_{{ common_name }}" diff --git a/tasks/database.yml b/tasks/database.yml index adc119b..2ae3fdf 100644 --- a/tasks/database.yml +++ b/tasks/database.yml @@ -8,13 +8,14 @@ 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 }}" + host: "{{ nextcloud_host }}" password: "{{ lookup('password', '/tmp/passwordfile chars=ascii_letters') }}" - priv: "{{ nextcloud_mysql_db }}.{{ inventory_hostname }}:ALL" + priv: "{{ nextcloud_mysql_db }}.*:ALL" state: present login_unix_socket: "{{ mysql_socket }}" login_user: root + update_password: on_create delegate_to: "{{ nextcloud_database_host }}"