From 74883a564d05f4c116bf60e278038c9e3c3c0078 Mon Sep 17 00:00:00 2001 From: Jesper Hess Nielsen Date: Fri, 2 Sep 2022 12:23:19 +0200 Subject: [PATCH] Add handler to restart nginx container when adding nextcloud VHost config --- roles/docker/handlers/main.yml | 7 +++++++ roles/docker/tasks/services/nextcloud.yml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 roles/docker/handlers/main.yml diff --git a/roles/docker/handlers/main.yml b/roles/docker/handlers/main.yml new file mode 100644 index 00000000..8958588d --- /dev/null +++ b/roles/docker/handlers/main.yml @@ -0,0 +1,7 @@ +--- +- name: "restart nginx" + community.docker.docker_container: + name: "nginx-proxy" + restart: "yes" + state: "started" + \ No newline at end of file diff --git a/roles/docker/tasks/services/nextcloud.yml b/roles/docker/tasks/services/nextcloud.yml index 4b62e8f7..38adfd22 100644 --- a/roles/docker/tasks/services/nextcloud.yml +++ b/roles/docker/tasks/services/nextcloud.yml @@ -2,7 +2,8 @@ - name: upload vhost config for cloud.data.coop template: src: files/configs/nextcloud/vhost - dst: "{{ nginx.volume_folder }}/vhost/{{ nextcloud.domain }}" + dest: "{{ nginx.volume_folder }}/vhost/{{ nextcloud.domain }}" + notify: "restart nginx" - name: setup nextcloud containers docker_compose: