|
9 | 9 | delegate_to: localhost |
10 | 10 | run_once: true |
11 | 11 |
|
| 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 | + |
12 | 22 | - name: Check no host appears in more than one nodegroup |
13 | 23 | assert: |
14 | 24 | that: "{{ _openhpc_check_hosts.values() | select('greaterthan', 1) | length == 0 }}" |
|
21 | 31 | delegate_to: localhost |
22 | 32 | run_once: true |
23 | 33 |
|
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 |
45 | 35 | ansible.builtin.assert: |
46 | 36 | 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" |
48 | 38 | loop: "{{ openhpc_nodegroups }}" |
49 | 39 | when: |
50 | 40 | - item.gres_autodetect | default(openhpc_gres_autodetect) == 'off' |
|
0 commit comments