Skip to content

Commit 1d63453

Browse files
committed
v5 - fix grestypes when none
1 parent 6ebea62 commit 1d63453

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

defaults/main.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ openhpc_default_config:
4141
PropagateResourceLimitsExcept: MEMLOCK
4242
Epilog: /etc/slurm/slurm.epilog.clean
4343
ReturnToService: 2
44-
GresTypes: "{{ ohpc_gres_types | flatten | sort | unique | join(',') if ohpc_gres_types else 'omit' }}"
44+
GresTypes: "{{ ohpc_gres_types if ohpc_gres_types != '' else 'omit' }}"
4545
openhpc_cgroup_default_config:
4646
ConstrainCores: "yes"
4747
ConstrainDevices: "yes"
@@ -50,18 +50,16 @@ openhpc_cgroup_default_config:
5050

5151
openhpc_config: {}
5252
openhpc_cgroup_config: {}
53-
ohpc_gres_types:
54-
# toplevel nvml autodetect:
55-
- "{{ ['gpu'] if openhpc_gres_autodetect == 'nvml' else [] }}"
56-
# nodegroup nvml autodetect:
57-
- "{{ ['gpu'] if openhpc_nodegroups | map(attribute='gres_autodetect', default='') | unique | select('eq', 'nvml') else [] }}"
58-
# nodegroup specific gres conf:
59-
- "{{
60-
openhpc_nodegroups |
53+
ohpc_gres_types: >-
54+
{{
55+
(
56+
['gpu'] if openhpc_gres_autodetect == 'nvml' else [] +
57+
['gpu'] if openhpc_nodegroups | map(attribute='gres_autodetect', default='') | unique | select('eq', 'nvml') else [] +
58+
openhpc_nodegroups |
6159
community.general.json_query('[].gres[].conf') |
6260
map('regex_search', '^(\\w+)')
63-
}}"
64-
61+
) | flatten | reject('eq', '') | sort | unique | join(',')
62+
}}
6563
openhpc_gres_template: gres.conf.j2
6664
openhpc_cgroup_template: cgroup.conf.j2
6765

0 commit comments

Comments
 (0)