|
84 | 84 | ansible.builtin.tempfile: |
85 | 85 | register: _slurm_conf_tmpfile |
86 | 86 | 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 |
88 | 88 | changed_when: false # so molecule doesn't fail |
89 | 89 | become: no |
90 | 90 |
|
|
95 | 95 | lstrip_blocks: true |
96 | 96 | mode: 0644 |
97 | 97 | 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 |
99 | 99 | changed_when: false # so molecule doesn't fail |
100 | 100 | become: no |
101 | 101 |
|
|
110 | 110 | mode: 0644 |
111 | 111 | loop: "{{ openhpc_config | dict2items }}" |
112 | 112 | 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 |
114 | 114 | changed_when: false # so molecule doesn't fail |
115 | 115 | become: no |
116 | 116 |
|
|
121 | 121 | owner: root |
122 | 122 | group: root |
123 | 123 | 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 |
125 | 125 | notify: |
126 | 126 | - Restart slurmctld service |
127 | 127 | register: ohpc_slurm_conf |
|
134 | 134 | mode: "0600" |
135 | 135 | owner: slurm |
136 | 136 | 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 |
138 | 138 | notify: |
139 | 139 | - Restart slurmctld service |
140 | 140 | register: ohpc_gres_conf |
|
148 | 148 | mode: "0644" # perms/ownership based off src from ohpc package |
149 | 149 | owner: root |
150 | 150 | 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 |
152 | 152 |
|
153 | 153 | - name: Remove local tempfile for slurm.conf templating |
154 | 154 | ansible.builtin.file: |
|
169 | 169 | notify: |
170 | 170 | - Restart slurmd service |
171 | 171 |
|
172 | | -- name: Set slurmctld location for configless operation |
| 172 | +- name: Configure slurmd command line options |
| 173 | + vars: |
| 174 | + slurmd_options_configless: "--conf-server {{ openhpc_slurm_control_host_address | default(openhpc_slurm_control_host) }}" |
| 175 | + slurmd_options: "" |
173 | 176 | lineinfile: |
174 | 177 | path: /etc/sysconfig/slurmd |
175 | | - line: "SLURMD_OPTIONS='--conf-server {{ openhpc_slurm_control_host_address | default(openhpc_slurm_control_host) }}'" |
| 178 | + line: "SLURMD_OPTIONS='{{ slurmd_options_configless if openhpc_slurm_configless | bool else slurmd_options }}'" |
176 | 179 | regexp: "^SLURMD_OPTIONS=" |
177 | 180 | create: yes |
178 | 181 | owner: root |
179 | 182 | group: root |
180 | 183 | mode: 0644 |
181 | 184 | when: |
182 | 185 | - openhpc_enable.batch | default(false) |
183 | | - - openhpc_slurm_configless |
184 | 186 | notify: |
185 | 187 | - Restart slurmd service |
186 | 188 | # 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