From dd295b4129b1322057c9a75f83bbec696e46fd81 Mon Sep 17 00:00:00 2001 From: Johanna Dorothea Reichmann Date: Thu, 21 Oct 2021 22:21:24 +0200 Subject: [PATCH] chore(server): allow configuring dbhost even after first initialization --- roles/server/tasks/main.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/roles/server/tasks/main.yml b/roles/server/tasks/main.yml index a6e2750..a07fc1f 100644 --- a/roles/server/tasks/main.yml +++ b/roles/server/tasks/main.yml @@ -130,3 +130,20 @@ user: "{{ nextcloud_user_info.uid }}" tty: yes when: nextcloud_current_backgroundjob_mode.stdout != nextcloud_background_job_mode + +- name: Check nextcloud database host + community.docker.docker_container_exec: + container: "{{ nextcloud_container_name }}" + command: "{{ nextcloud_occ_command }} config:system:get dbhost" + user: "{{ nextcloud_user_info.uid }}" + tty: yes + register: nextcloud_current_dbhost + +- name: Set nextcloud database host mode to {{ nextcloud_database_host }} + community.docker.docker_container_exec: + container: "{{ nextcloud_container_name }}" + command: "{{ nextcloud_occ_command }} config:system:set dbhost --value={{ nextcloud_database_host }} --update-only -n" + user: "{{ nextcloud_user_info.uid }}" + tty: yes + when: nextcloud_current_dbhost.stdout != nextcloud_database_host + notify: restart-nextcloud