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