Skip to content

Improve behaviour when switching configless mode off #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions tasks/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -169,18 +169,20 @@
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
group: root
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.
Expand Down
2 changes: 1 addition & 1 deletion templates/slurm.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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