Skip to content

Commit c2ffc24

Browse files
committed
WIP
1 parent 43eefc8 commit c2ffc24

10 files changed

Lines changed: 46 additions & 29 deletions

File tree

roles/sram_ldap/handlers/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
name: "sram-ldap"
55
restart: true
66
state: started
7+
when: ldap_container is success and ldap_container is not change

roles/sram_ldap/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
- "bash"
9090
- "-c"
9191
- "[[ -S /var/run/slapd/ldapi ]]"
92-
register: "ldap_container"
92+
register: ldap_container
9393

9494
- name: Wait for LDAP initialization
9595
ansible.builtin.wait_for:
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- name: Restart the satosa container
3+
community.docker.docker_container:
4+
name: sram-satosa
5+
restart: true
6+
state: started
7+
when: satosa_container is success and satosa_container is not change

roles/sram_midproxy/tasks/main.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
group: "{{ sram_midproxy_group }}"
3939
# mkdir: cannot create directory '.': Permission denied
4040
mode: "0644"
41+
notify: Restart the satosa container
4142

4243
- name: Copy SATOSA conf files
4344
ansible.builtin.copy:
@@ -49,20 +50,21 @@
4950
- internal_attributes.yaml
5051
- proxy_conf.yaml
5152
- plugins/
53+
notify: Restart the satosa container
5254

53-
- name: "Pull satosa image"
54-
community.docker.docker_image_pull:
55-
name: "{{ sram_midproxy_satosa_image }}"
56-
register: "satosa_image"
55+
# - name: "Pull satosa image"
56+
# community.docker.docker_image_pull:
57+
# name: "{{ sram_midproxy_satosa_image }}"
58+
# register: "satosa_image"
5759

5860
- name: Create the SATOSA container
5961
community.docker.docker_container:
6062
name: sram-midproxy
6163
image: "{{ sram_midproxy_satosa_image }}"
62-
pull: never
64+
pull: true
6365
restart_policy: "always"
6466
state: started
65-
restart: "{{ satosa_image is changed }}"
67+
# restart: "{{ satosa_image is changed }}"
6668
# 2026-05-21 07:25:44 +0000] [1] [ERROR] Control server error: [Errno 13] Permission denied: '/.gunicorn'
6769
# user: "{{ midproxy_user_uid }}"
6870
networks:
@@ -88,3 +90,4 @@
8890
# timeout: 10s
8991
# retries: 3
9092
# start_period: 10s
93+
register: satosa_container

roles/sram_plsc/handlers/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
name: sram-plsc
55
restart: true
66
state: started
7+
when: plsc_container is success and plsc_container is not change

roles/sram_plsc/tasks/main.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,24 @@
1313
no_log: "{{ sram_plsc_ansible_nolog }}"
1414
notify: "Restart the plsc container"
1515

16-
- name: "Pull plsc image"
17-
community.docker.docker_image_pull:
18-
name: "{{ sram_plsc_image }}"
19-
register: "plsc_image"
16+
# - name: "Pull plsc image"
17+
# community.docker.docker_image_pull:
18+
# name: "{{ sram_plsc_image }}"
19+
# register: "plsc_image"
2020

2121
- name: Create the plsc container
2222
community.docker.docker_container:
2323
name: "sram-plsc"
2424
image: "{{ sram_plsc_image }}"
2525
restart_policy: "always"
26-
state: started
27-
restart: "{{ plsc_image is changed }}"
28-
pull: never
26+
state: "started"
27+
# restart: "{{ plsc_image is changed }}"
28+
pull: true
2929
mounts:
3030
- type: bind
3131
source: "{{ sram_plsc_conf_dir }}/plsc.yml"
3232
target: "/opt/plsc/plsc.yml"
3333
networks:
3434
# TODO: Should this not be parametrized?
3535
- name: "loadbalancer"
36+
register: "plsc_container"

roles/sram_redis/handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
name: sram-redis
55
state: started
66
restart: true
7-
when: rediscontainer is success and rediscontainer is not change
7+
when: redis_container is success and redis_container is not change

roles/sram_redis/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@
6161
networks:
6262
# TODO: Should this not be parametrized?
6363
- name: loadbalancer
64-
register: rediscontainer
64+
register: redis_container

roles/sram_sbs/handlers/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
loop:
88
- sram-sbs-client
99
- sram-sbs-server
10+
when: sbs_container is success and sbs_container is not change

roles/sram_sbs/tasks/main.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,25 @@
6666
no_log: "{{ sram_sbs_ansible_nolog }}"
6767
notify: "Restart sbs containers"
6868

69-
- name: "Pull sbs image"
70-
community.docker.docker_image_pull:
71-
name: "{{ item }}"
72-
with_items:
73-
- "{{ sram_sbs_client_image }}"
74-
- "{{ sram_sbs_server_image }}"
75-
register: "sbs_images"
69+
# - name: "Pull sbs image"
70+
# community.docker.docker_image_pull:
71+
# name: "{{ item }}"
72+
# with_items:
73+
# - "{{ sram_sbs_client_image }}"
74+
# - "{{ sram_sbs_server_image }}"
75+
# register: "sbs_images"
7676

7777
- name: "Migration"
7878
# For some reason --check breaks this block
79-
when: "sbs_images is changed and not ansible_check_mode"
79+
# when: "sbs_images is changed and not ansible_check_mode"
80+
when: "not ansible_check_mode"
8081
block:
8182
- name: "Run SBS migrations"
8283
throttle: 1
8384
community.docker.docker_container:
8485
name: "sram-sbs-migration"
8586
image: "{{ sram_sbs_server_image }}"
86-
pull: "never"
87+
pull: true
8788
state: "started"
8889
restart_policy: "no"
8990
detach: false
@@ -99,7 +100,7 @@
99100
networks:
100101
# TODO: Should we parametrize this?
101102
- name: "loadbalancer"
102-
register: "result"
103+
register: "sbs_container"
103104
failed_when: "'container' not in result or result.container.State.ExitCode != 0"
104105
changed_when: "'[alembic.runtime.migration] Running upgrade' in result.container.Output | default('')"
105106
notify: "Restart sbs containers"
@@ -115,10 +116,10 @@
115116
community.docker.docker_container:
116117
name: "sram-sbs-client"
117118
image: "{{ sram_sbs_client_image }}"
118-
pull: "never"
119+
pull: true
119120
restart_policy: "always"
120121
state: "started"
121-
restart: "{{ sbs_images is changed}}"
122+
# restart: "{{ sbs_images is changed}}"
122123
volumes:
123124
- "{{ sram_sbs_conf_dir }}/sbs-apache.conf:/etc/apache2/sites-enabled/sbs.conf:ro"
124125
- "{{ sram_sbs_conf_dir }}/disclaimer.css:/opt/sbs/client/dist/disclaimer.css:ro"
@@ -128,14 +129,15 @@
128129
traefik.http.routers.sbsclient.rule: "Host(`{{ sram_sbs_base_domain }}`)"
129130
traefik.http.routers.sbsclient.tls: "true"
130131
traefik.enable: "true"
132+
notify: "Restart sbs containers"
131133

132134
- name: "Start SBS server container"
133135
community.docker.docker_container:
134136
name: "sram-sbs-server"
135137
image: "{{ sram_sbs_server_image }}"
136138
restart_policy: "always"
137139
state: "started"
138-
restart: "{{ sbs_images is changed}}"
140+
# restart: "{{ sbs_images is changed}}"
139141
env:
140142
RUNAS_UID: "{{ sbs_user_uid | string }}"
141143
RUNAS_GID: "{{ sbs_group_gid | string }}"
@@ -151,3 +153,4 @@
151153
- name: "loadbalancer"
152154
etc_hosts:
153155
host.docker.internal: host-gateway
156+
notify: "Restart sbs containers"

0 commit comments

Comments
 (0)