diff --git a/tasks/runtime.yml b/tasks/runtime.yml index 3eeb52f..18d75f7 100644 --- a/tasks/runtime.yml +++ b/tasks/runtime.yml @@ -84,7 +84,7 @@ ansible.builtin.tempfile: register: _slurm_conf_tmpfile delegate_to: localhost - when: openhpc_enable.control | default(false) or not openhpc_slurm_configless + when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool changed_when: false # so molecule doesn't fail become: no @@ -95,7 +95,7 @@ lstrip_blocks: true mode: 0644 delegate_to: localhost - when: openhpc_enable.control | default(false) or not openhpc_slurm_configless + when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool changed_when: false # so molecule doesn't fail become: no @@ -110,7 +110,7 @@ mode: 0644 loop: "{{ openhpc_config | dict2items }}" delegate_to: localhost - when: openhpc_enable.control | default(false) or not openhpc_slurm_configless + when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool changed_when: false # so molecule doesn't fail become: no @@ -121,7 +121,7 @@ owner: root group: root mode: 0644 - when: openhpc_enable.control | default(false) or not openhpc_slurm_configless + when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool notify: - Restart slurmctld service register: ohpc_slurm_conf @@ -134,7 +134,7 @@ mode: "0600" owner: slurm group: slurm - when: openhpc_enable.control | default(false) or not openhpc_slurm_configless + when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool notify: - Restart slurmctld service register: ohpc_gres_conf @@ -148,7 +148,7 @@ mode: "0644" # perms/ownership based off src from ohpc package owner: root group: root - when: openhpc_enable.control | default(false) or not openhpc_slurm_configless + when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool - name: Remove local tempfile for slurm.conf templating ansible.builtin.file: @@ -169,10 +169,13 @@ notify: - Restart slurmd service -- name: Set slurmctld location for configless operation +- name: Configure slurmd command line options + vars: + slurmd_options_configless: "--conf-server {{ openhpc_slurm_control_host_address | default(openhpc_slurm_control_host) }}" + slurmd_options: "" lineinfile: path: /etc/sysconfig/slurmd - line: "SLURMD_OPTIONS='--conf-server {{ openhpc_slurm_control_host_address | default(openhpc_slurm_control_host) }}'" + line: "SLURMD_OPTIONS='{{ slurmd_options_configless if openhpc_slurm_configless | bool else slurmd_options }}'" regexp: "^SLURMD_OPTIONS=" create: yes owner: root @@ -180,7 +183,6 @@ mode: 0644 when: - openhpc_enable.batch | default(false) - - openhpc_slurm_configless notify: - Restart slurmd service # 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. diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index 15da07d..94f0465 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -184,6 +184,6 @@ PartitionName={{part.name}} Default={{ part.get('default', 'YES') }} MaxTime={{ # Define a non-existent node, in no partition, so that slurmctld starts even with all partitions empty NodeName=nonesuch -{% if openhpc_slurm_configless %}SlurmctldParameters=enable_configless{% endif %} +{% if openhpc_slurm_configless | bool %}SlurmctldParameters=enable_configless{% endif %} ReturnToService=2