Skip to content

Commit 1617c96

Browse files
committed
make openhpc_slurm_configless depend on openhpc_config
1 parent 97268e6 commit 1617c96

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

defaults/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ openhpc_drain_timeout: 86400
1111
openhpc_resume_timeout: 300
1212
openhpc_retry_delay: 10
1313
openhpc_job_maxtime: 24:00:00
14-
openhpc_slurm_configless: false
15-
openhpc_config: "{{ {'SlurmctldParameters':['enable_configless']} if openhpc_slurm_configless else {} }}"
14+
openhpc_config: "{{ openhpc_extra_config | default({}) }}"
15+
openhpc_slurm_configless: "{{ true if ('enable_configless' in openhpc_config.get('SlurmctldParameters', [])) else false }}"
16+
1617
openhpc_state_save_location: /var/spool/slurm
1718

1819
# Accounting

tasks/runtime.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
ansible.builtin.tempfile:
7878
register: _slurm_conf_tmpfile
7979
delegate_to: localhost
80-
when: openhpc_enable.control | default(false) or not 'enable_configless' in openhpc_config.SlurmctldParameters | default([])
80+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
8181
changed_when: false # so molecule doesn't fail
8282
become: no
8383

@@ -88,7 +88,7 @@
8888
lstrip_blocks: true
8989
mode: 0644
9090
delegate_to: localhost
91-
when: openhpc_enable.control | default(false) or not 'enable_configless' in openhpc_config.SlurmctldParameters | default([])
91+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
9292
changed_when: false # so molecule doesn't fail
9393
become: no
9494

@@ -103,7 +103,7 @@
103103
mode: 0644
104104
loop: "{{ openhpc_config | dict2items }}"
105105
delegate_to: localhost
106-
when: openhpc_enable.control | default(false) or not 'enable_configless' in openhpc_config.SlurmctldParameters | default([])
106+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
107107
changed_when: false # so molecule doesn't fail
108108
become: no
109109

@@ -114,7 +114,7 @@
114114
owner: root
115115
group: root
116116
mode: 0644
117-
when: openhpc_enable.control | default(false) or not 'enable_configless' in openhpc_config.SlurmctldParameters | default([])
117+
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless
118118
notify:
119119
- Restart slurmctld service
120120
register: ohpc_slurm_conf
@@ -150,7 +150,7 @@
150150
mode: 0644
151151
when:
152152
- openhpc_slurm_service == 'slurmd'
153-
- "'enable_configless' in openhpc_config.SlurmctldParameters | default([])"
153+
- openhpc_slurm_configless
154154
notify:
155155
- Restart slurmd service
156156
# 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.

0 commit comments

Comments
 (0)