Skip to content

Commit cc31876

Browse files
authored
Merge pull request #129 from stackhpc/fix/slurmdbd-restart
Add wait_for slurmdbd port
2 parents a0d6f53 + c509d5c commit cc31876

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

handlers/main.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
when: openhpc_slurm_service_started | bool
88

99
# NOTE: we need this running before slurmctld start
10-
- name: Restart slurmdbd service
10+
- name: Issue slurmdbd restart command
1111
service:
1212
name: "slurmdbd"
1313
state: restarted
@@ -17,6 +17,18 @@
1717
- openhpc_slurm_service_started | bool
1818
- openhpc_slurmdbd_host in play_hosts
1919
run_once: true
20+
listen: Restart slurmdbd service
21+
22+
- name: Check slurmdbd actually restarted
23+
wait_for:
24+
port: "{{ openhpc_slurmdbd_port }}"
25+
delegate_to: "{{ openhpc_slurmdbd_host }}"
26+
run_once: true
27+
when:
28+
- openhpc_slurmdbd_host is defined
29+
- openhpc_slurm_service_started | bool
30+
- openhpc_slurmdbd_host in play_hosts
31+
listen: Restart slurmdbd service
2032

2133
# NOTE: we need this running before slurmd
2234
# Allows you to reconfigure slurmctld from another host

tasks/runtime.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,16 @@
163163
enabled: "{{ openhpc_slurm_service_enabled | bool }}"
164164
state: "{{ 'started' if openhpc_slurm_service_started | bool else 'stopped' }}"
165165

166+
- name: flush handler
167+
meta: flush_handlers # as then subsequent "ensure" is a no-op if slurm services bounced
168+
166169
- name: Ensure slurmdbd is started and running
167170
service:
168171
name: slurmdbd
169172
enabled: "{{ openhpc_slurm_service_enabled | bool }}"
170173
state: "{{ 'started' if openhpc_slurm_service_started | bool else 'stopped' }}"
171174
when: openhpc_enable.database | default(false) | bool
172175

173-
- name: flush handler
174-
meta: flush_handlers # as then subsequent "ensure" is a no-op if slurm services bounced
175-
176176
- name: Ensure Slurm service state
177177
service:
178178
name: "{{ openhpc_slurm_service }}"

0 commit comments

Comments
 (0)