From eab05caa83208a1717abb325a60008c5fec9fa9f Mon Sep 17 00:00:00 2001 From: Peter Havekes Date: Thu, 19 Sep 2024 10:38:21 +0200 Subject: [PATCH] Only restart the container if not new --- roles/myconext/handlers/main.yml | 1 + roles/myconext/tasks/main.yml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/myconext/handlers/main.yml b/roles/myconext/handlers/main.yml index f0285c7e7..b0361a551 100644 --- a/roles/myconext/handlers/main.yml +++ b/roles/myconext/handlers/main.yml @@ -3,3 +3,4 @@ name: myconextserver state: started restart: true + when: myconextservercontainer is success and myconextservercontainer is not change diff --git a/roles/myconext/tasks/main.yml b/roles/myconext/tasks/main.yml index afb09dd8a..c5d424713 100644 --- a/roles/myconext/tasks/main.yml +++ b/roles/myconext/tasks/main.yml @@ -14,7 +14,7 @@ owner: root group: root mode: "0644" - + - name: Create directory to keep configfiles ansible.builtin.file: dest: "/opt/openconext/myconext" @@ -124,6 +124,8 @@ timeout: 10s retries: 3 start_period: 10s + register: myconextservercontainer + - name: Create the client container community.docker.docker_container: @@ -191,4 +193,3 @@ env: HTTPD_CSP: "{{ httpd_csp.lenient_with_static_img_for_idp }}" HTTPD_SERVERNAME: "login.{{ myconext_base_domain }}" -