Skip to content

Commit 6ca46dd

Browse files
committed
fixup validation
1 parent 1d63453 commit 6ca46dd

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

tasks/validate.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99
delegate_to: localhost
1010
run_once: true
1111

12+
- name: Validate nodegroups define names
13+
# Needed for the next check..
14+
# NB: Don't validate names against inventory groups as those are allowed to be missing
15+
ansible.builtin.assert:
16+
that: "'name' in item"
17+
fail_msg: "A mapping in openhpc_nodegroups is missing 'name'"
18+
loop: "{{ openhpc_nodegroups }}"
19+
delegate_to: localhost
20+
run_once: true
21+
1222
- name: Check no host appears in more than one nodegroup
1323
assert:
1424
that: "{{ _openhpc_check_hosts.values() | select('greaterthan', 1) | length == 0 }}"
@@ -21,30 +31,10 @@
2131
delegate_to: localhost
2232
run_once: true
2333

24-
25-
# - name: Validate openhpc_nodegroups contain name
26-
# ansible.builtin.assert:
27-
# that:
28-
# - "'name' in nodegroup
29-
# - openhpc_cluster_name ~ '_' ~ nodegroup.name in group_names
30-
# fail_msg: "nodegroup does not specify a name or openhpc_cluster_name ~ '_' ~ nodegroup.name not found in inventory"
31-
32-
# loop: "{{ openhpc_nodegroups }}"
33-
34-
- name: debug openhpc_nodegroups
35-
ansible.builtin.debug:
36-
msg: "{{ (item.gres | select('contains', 'file')) }} == {{ (item.gres | length) }}"
37-
loop: "{{ openhpc_nodegroups }}"
38-
when:
39-
- item.gres_autodetect | default(openhpc_gres_autodetect) == 'off'
40-
- "'gres' in item"
41-
delegate_to: localhost
42-
run_once: true
43-
44-
- name: Validate openhpc_nodegroups
34+
- name: Validate GRES definitions
4535
ansible.builtin.assert:
4636
that: "(item.gres | select('contains', 'file') | length) == (item.gres | length)"
47-
fail_msg: "GRES configuration(s) in openhpc_nodegroup '{{ item.name }}' do not include 'file' but GRES autodetection is not enabled"
37+
fail_msg: "GRES configuration(s) in openhpc_nodegroups '{{ item.name }}' do not include 'file' but GRES autodetection is not enabled"
4838
loop: "{{ openhpc_nodegroups }}"
4939
when:
5040
- item.gres_autodetect | default(openhpc_gres_autodetect) == 'off'

0 commit comments

Comments
 (0)