File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 43
43
# below produced by dev/setup-env.sh - gives empty list if file is missing:
44
44
_requirements_installed : " {{ ((lookup('file', _requirements_path + '.last', errors='ignore') or '{}') | from_yaml ).values() | flatten }}"
45
45
46
+ - name : Validate OpenTofu templated inventory is appropriate
47
+ # This "documents" the assumptions that Ansible makes about the
48
+ # OpenTofu-provided inventory
49
+ hosts : localhost
50
+ gather_facts : false
51
+ tags :
52
+ - validate
53
+ - opentofu
54
+ tasks :
55
+ - name : Check templated groups
56
+ assert :
57
+ that :
58
+ - item in groups
59
+ - groups[item] | length > 0
60
+ fail_msg : >
61
+ Expected inventory group '{{ item }}' is missing or empty:
62
+ - Check OpenTofu inventory template is up to date
63
+ - Check OpenTofu configuration defines 'login' and 'compute' variables properly
64
+ loop :
65
+ - control
66
+ - compute
67
+ - login
68
+ - name : Check templated 'all' vars
69
+ assert :
70
+ that :
71
+ - openhpc_cluster_name is defined
72
+ - cluster_domain_suffix is defined
73
+ - cluster_home_volume is defined
74
+ - cluster_compute_groups is defined
75
+ fail_msg : " One or more expected variables are missing: is OpenTofu inventory template up to date?"
76
+
46
77
- name : Ensure control node is in inventory
47
78
hosts : all
48
79
gather_facts : false
You can’t perform that action at this time.
0 commit comments