Skip to content

Commit f93abd0

Browse files
committed
fix login-only nodes when configless: new role var openhpc_enable.login
1 parent db63427 commit f93abd0

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ package in the image.
2525
* `control`: whether to enable control host
2626
* `database`: whether to enable slurmdbd
2727
* `batch`: whether to enable compute nodes
28+
* `login`: whether to enable login-only nodes in configless mode (for combined control/login nodes this can be left false)
2829
* `runtime`: whether to enable OpenHPC runtime
2930
* `drain`: whether to drain compute nodes
3031
* `resume`: whether to resume compute nodes

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ openhpc_slurmdbd_mysql_username: slurm
3838
openhpc_enable:
3939
control: false
4040
batch: false
41+
login: true
4142
database: false
4243
runtime: false
4344
drain: false
4445
resume: false
4546
ohpc_slurm_services:
4647
control: slurmctld
4748
batch: slurmd
49+
login: slurmd
4850
ohpc_release_repos:
4951
"7": "https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm" # ohpc v1.3 for Centos 7
5052
"8": "http://repos.openhpc.community/OpenHPC/2/CentOS_8/x86_64/ohpc-release-2-1.el8.x86_64.rpm" # ohpc v2 for Centos 8

tasks/runtime.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
notify:
4444
- Restart Munge service
4545

46+
- name: Set fact for login-only nodes
47+
# needed b/c openhpc_enable doesn't end up in hostvars
48+
set_fact:
49+
openhpc_login_only: "{{ openhpc_enable.login | default(false) | bool }}"
50+
4651
- name: Template slurmdbd.conf
4752
template:
4853
src: slurmdbd.conf.j2
@@ -75,7 +80,7 @@
7580
group: root
7681
mode: 0644
7782
when:
78-
- openhpc_enable.batch | default(false) | bool
83+
- (openhpc_enable.batch | default(false) | bool) or (openhpc_enable.login | default(false) | bool)
7984
- openhpc_slurm_configless
8085
notify:
8186
- Reload SLURM service

templates/slurm.conf.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ PartitionName={{part.name}} \
137137
{% endfor %}{# group #}
138138
{% endfor %}{# partitions #}
139139

140+
141+
# Define slurmd nodes not in partitions for configless login-only nodes:
142+
{% for node in hostvars %}
143+
{% if hostvars[node].openhpc_login_only %}
144+
NodeName={{ node }}
145+
{% endif %}
146+
{% endfor %}{# configless login-only #}
147+
140148
# Want nodes that drop out of SLURM's configuration to be automatically
141149
# returned to service when they come back.
142150
ReturnToService=2

0 commit comments

Comments
 (0)