Skip to content

Commit

Permalink
Only restart the container if not new
Browse files Browse the repository at this point in the history
  • Loading branch information
phavekes committed Sep 19, 2024
1 parent 9c268dc commit a752a8e
Show file tree
Hide file tree
Showing 38 changed files with 59 additions and 22 deletions.
1 change: 1 addition & 0 deletions roles/attribute-aggregation/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
name: aaserver
state: started
restart: true
when: attribute-aggregationservercontainer is success and attribute-aggregationservercontainer is not change
2 changes: 1 addition & 1 deletion roles/attribute-aggregation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
timeout: 10s
retries: 3
start_period: 10s
notify: restart attribute-aggregationserver
register: attribute-aggregationservercontainer

- name: Create the gui container
community.docker.docker_container:
Expand Down
1 change: 1 addition & 0 deletions roles/dashboard/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
name: dashboardserver
state: started
restart: true
when: dashboardservercontainer is success and dashboardservercontainer is not change
2 changes: 1 addition & 1 deletion roles/dashboard/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
timeout: 10s
retries: 3
start_period: 10s
notify: restart dashboardserver
register: dashboardservercontainer

- name: Create the gui container
community.docker.docker_container:
Expand Down
1 change: 1 addition & 0 deletions roles/invite/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name: inviteserver
state: started
restart: true
when: inviteservercontainer is success and inviteservercontainer is not change

- name: restart inviteprovisioningmock
community.docker.docker_container:
Expand Down
2 changes: 2 additions & 0 deletions roles/invite/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
timeout: 10s
retries: 3
start_period: 10s
register: inviteservercontainer


- name: Create the client container
community.docker.docker_container:
Expand Down
1 change: 1 addition & 0 deletions roles/lifecycle/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
name: lifecycle
state: started
restart: true
when: lifecycleservercontainer is success and lifecycleservercontainer is not change
2 changes: 2 additions & 0 deletions roles/lifecycle/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
- source: /opt/openconext/lifecycle
target: /var/www/html/config/openconext
type: bind
register: lifecyclecontainer


#- name: Create daily cronjob
# cron:
Expand Down
1 change: 1 addition & 0 deletions roles/manage/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
name: manageserver
state: started
restart: true
when: manageserverervercontainer is success and manageserverervercontainer is not change
2 changes: 2 additions & 0 deletions roles/manage/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
target: /__cacert_entrypoint.sh
type: bind


command: "java -jar /app.jar -Xmx512m --spring.config.location=./config/"
etc_hosts:
host.docker.internal: host-gateway
Expand All @@ -114,6 +115,7 @@
timeout: 10s
retries: 3
start_period: 10s
register: manageserverervercontainer

- name: Create the gui container
community.docker.docker_container:
Expand Down
1 change: 1 addition & 0 deletions roles/myconext/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
name: myconextserver
state: started
restart: true
when: myconextservercontainer is success and myconextservercontainer is not change
5 changes: 3 additions & 2 deletions roles/myconext/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
owner: root
group: root
mode: "0644"

- name: Create directory to keep configfiles
ansible.builtin.file:
dest: "/opt/openconext/myconext"
Expand Down Expand Up @@ -124,6 +124,8 @@
timeout: 10s
retries: 3
start_period: 10s
register: myconextservercontainer


- name: Create the client container
community.docker.docker_container:
Expand Down Expand Up @@ -191,4 +193,3 @@
env:
HTTPD_CSP: "{{ httpd_csp.lenient_with_static_img_for_idp }}"
HTTPD_SERVERNAME: "login.{{ myconext_base_domain }}"

1 change: 1 addition & 0 deletions roles/oidc-playground/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
name: oidcplaygroundserver
state: started
restart: true
when: oidcplaygroundservercontainer is success and oidcplaygroundservercontainer is not change
6 changes: 3 additions & 3 deletions roles/oidc-playground/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
timeout: 10s
retries: 3
start_period: 10s
notify: restart oidc-playground-docker
register: oidcplaygroundservercontainer

- name: Create the gui container
community.docker.docker_container:
Expand Down Expand Up @@ -92,7 +92,7 @@
# entity_type: oauth20_rs
#
# - name: Include the role manage_provision_entities to provision oidc-playground client to Manage
# include_role:
# include_role:
# name: manage_provision_entities
# vars:
# vars:
# entity_type: oidc10_rp
3 changes: 2 additions & 1 deletion roles/oidcng/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: "restart oidcng"
community.docker.docker_container:
name: dashboardserver
name: oidcngserver
state: started
restart: true
when: oidcngservercontainer is success and oidcngservercontainer is not change
3 changes: 2 additions & 1 deletion roles/oidcng/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
src: oidc_saml_mapping.json
dest: "{{ oidcng_dir }}"
owner: "root"
group: "root"
group: "root"
mode: "0640"
notify:
- "restart oidcng"
Expand Down Expand Up @@ -136,6 +136,7 @@
traefik.http.routers.oidcng.middlewares: oidcngmw@docker
traefik.http.middlewares.oidcngmw.replacepathregex.regex: "^/.well-known/openid-configuration"
traefik.http.middlewares.oidcngmw.replacepathregex.replacement: "/oidc/.well-known/openid-configuration"
register: oidcngservercontainer



Expand Down
1 change: 1 addition & 0 deletions roles/pdp/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
name: pdpserver
state: started
restart: true
when: pdpservercontainer is success and pdpservercontainer is not change
4 changes: 2 additions & 2 deletions roles/pdp/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
timeout: 10s
retries: 3
start_period: 10s
notify: restart pdpserver

register: pdpservercontainer
- name: Create the gui container
community.docker.docker_container:
name: pdpgui
Expand Down
1 change: 1 addition & 0 deletions roles/profile/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
name: profile
state: started
restart: true
when: profileservercontainer is success and profileservercontainer is not change
3 changes: 2 additions & 1 deletion roles/profile/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@
- source: /etc/localtime
target: /etc/localtime
type: bind

register: profilecontainer


- name: Include the role manage_provision_entities to provision profile to Manage
ansible.builtin.include_role:
Expand Down
3 changes: 2 additions & 1 deletion roles/stats/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
name: statsserver
state: started
restart: true
when: statsservercontainer is success and statsservercontainer is not change


- name: restart statsgui
community.docker.docker_container:
name: statsgui
state: started
restart: true

1 change: 1 addition & 0 deletions roles/stats/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
- source: /dev/log
target: /dev/log
type: bind
register: statsservercontainer

- name: Create and start the guicontainer
community.docker.docker_container:
Expand Down
1 change: 1 addition & 0 deletions roles/stepupazuremfa/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
name: azuremfa
state: started
restart: true
when: azuremfacontainer is success and azuremfacontainer is not change
1 change: 1 addition & 0 deletions roles/stepupazuremfa/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,4 @@
- source: /opt/openconext/azuremfa
target: /var/www/html/config/openconext
type: bind
regiter: azuremfacontainer
6 changes: 5 additions & 1 deletion roles/stepupgateway/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
state: reloaded

- name: restart gateway
command: docker restart gateway
community.docker.docker_container:
name: gateway
state: started
restart: true
when: gatewaycontainer is success and gatewaycontainer is not change
1 change: 1 addition & 0 deletions roles/stepupgateway/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,4 @@
- source: /opt/openconext/gateway/
target: /var/www/html/config/openconext
type: bind
register: gatewaycontainer
1 change: 1 addition & 0 deletions roles/stepupmiddleware/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
name: middleware
state: started
restart: true
when: middlewarecontainer is success and middlewarecontainer is not change
9 changes: 5 additions & 4 deletions roles/stepupmiddleware/tasks/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
start_period: 10s
etc_hosts:
host.docker.internal: host-gateway
register: middlewarecontainer

- name: Put middleware configuration scripts in /root/
ansible.builtin.template:
Expand Down Expand Up @@ -96,7 +97,7 @@
- "middleware-config.json"
- "middleware-whitelist.json"
- "middleware-institution.json"
tags:
tags:
- push_mw_config
- push_mw_institution
- push_mw_whitelist
Expand Down Expand Up @@ -127,20 +128,20 @@
"middleware-push-institution.sh": "05-middleware-institution.sh"

# The following push scripts have an additional conditional check on the presence of
# a tag, so these are only ran when explicitly called.
# a tag, so these are only ran when explicitly called.

- name: Push middleware configuration
ansible.builtin.command: /opt/scripts/middleware-push-config.sh
run_once: true
when:
- "'push_mw_config' in ansible_run_tags"
tags:
tags:
- push_mw_config

- name: Push middleware whitelist
ansible.builtin.command: /opt/scripts/middleware-push-whitelist.sh
run_once: True
when:
when:
- "'push_mw_whitelist' in ansible_run_tags"
tags:
- push_mw_whitelist
Expand Down
1 change: 1 addition & 0 deletions roles/stepupra/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
name: ra
state: started
restart: true
when: racontainer is success and racontainer is not change
1 change: 1 addition & 0 deletions roles/stepupra/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@
- source: /opt/openconext/ra
target: /var/www/html/config/openconext
type: bind
register: racontainer
1 change: 1 addition & 0 deletions roles/stepupselfservice/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
name: selfservice
state: started
restart: true
when: selfservicecontainer is success and selfservicecontainer is not change
1 change: 1 addition & 0 deletions roles/stepupselfservice/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@
- source: /opt/openconext/selfservice
target: /var/www/html/config/openconext
type: bind
register: selfservicecontainer
2 changes: 1 addition & 1 deletion roles/stepuptiqr/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
name: tiqr
state: started
restart: true

when: tiqrcontainer is success and tiqrcontainer is not change
3 changes: 2 additions & 1 deletion roles/stepuptiqr/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@
type: bind
- source: /opt/openconext/tiqr
target: /var/www/html/config/openconext
type: bind
type: bind
register: tiqrcontainer
1 change: 1 addition & 0 deletions roles/stepupwebauthn/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
name: webauthn
state: started
restart: true
when: webauthncontainer is success and webauthncontainer is not change
1 change: 1 addition & 0 deletions roles/stepupwebauthn/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,4 @@
- source: /opt/openconext/webauthn
target: /var/www/html/config/openconext
type: bind
register: webauthncontainer
2 changes: 1 addition & 1 deletion roles/teams/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
name: teamsserver
state: started
restart: true

when: teamsserverontainer is success and teamsserverontainer is not change
2 changes: 1 addition & 1 deletion roles/teams/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
timeout: 10s
retries: 3
start_period: 10s
notify: restart teamsserver
register: teamsserverontainer

- name: Create the gui container
community.docker.docker_container:
Expand Down

0 comments on commit a752a8e

Please sign in to comment.