Skip to content

Commit 19f5569

Browse files
committed
Fix openhpc_configless when set to false
Need to pass this through the bool filter so that string values are interpreted as booleans.
1 parent 31017d2 commit 19f5569

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tasks/runtime.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
ansible.builtin.tempfile:
8585
register: _slurm_conf_tmpfile
8686
delegate_to: localhost
87-
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
87+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool
8888
changed_when: false # so molecule doesn't fail
8989
become: no
9090

@@ -95,7 +95,7 @@
9595
lstrip_blocks: true
9696
mode: 0644
9797
delegate_to: localhost
98-
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
98+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool
9999
changed_when: false # so molecule doesn't fail
100100
become: no
101101

@@ -110,7 +110,7 @@
110110
mode: 0644
111111
loop: "{{ openhpc_config | dict2items }}"
112112
delegate_to: localhost
113-
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
113+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool
114114
changed_when: false # so molecule doesn't fail
115115
become: no
116116

@@ -121,7 +121,7 @@
121121
owner: root
122122
group: root
123123
mode: 0644
124-
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
124+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool
125125
notify:
126126
- Restart slurmctld service
127127
register: ohpc_slurm_conf
@@ -134,7 +134,7 @@
134134
mode: "0600"
135135
owner: slurm
136136
group: slurm
137-
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
137+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool
138138
notify:
139139
- Restart slurmctld service
140140
register: ohpc_gres_conf
@@ -148,7 +148,7 @@
148148
mode: "0644" # perms/ownership based off src from ohpc package
149149
owner: root
150150
group: root
151-
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
151+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool
152152

153153
- name: Remove local tempfile for slurm.conf templating
154154
ansible.builtin.file:
@@ -180,7 +180,7 @@
180180
mode: 0644
181181
when:
182182
- openhpc_enable.batch | default(false)
183-
- openhpc_slurm_configless
183+
- openhpc_slurm_configless | bool
184184
notify:
185185
- Restart slurmd service
186186
# Reloading is sufficent, but using a single handler means no bounce. Realistically this won't regularly change on a running slurmd so restarting is ok.

templates/slurm.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,5 +185,5 @@ PartitionName={{part.name}} Default={{ part.get('default', 'YES') }} MaxTime={{
185185
# Define a non-existent node, in no partition, so that slurmctld starts even with all partitions empty
186186
NodeName=nonesuch
187187

188-
{% if openhpc_slurm_configless %}SlurmctldParameters=enable_configless{% endif %}
188+
{% if openhpc_slurm_configless | bool %}SlurmctldParameters=enable_configless{% endif %}
189189
ReturnToService=2

0 commit comments

Comments
 (0)