Skip to content

Commit aaeecaf

Browse files
authored
Merge branch 'main' into feat/update-osc-ood
2 parents cd88331 + 919a7e2 commit aaeecaf

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

ansible/validate.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,37 @@
4343
# below produced by dev/setup-env.sh - gives empty list if file is missing:
4444
_requirements_installed: "{{ ((lookup('file', _requirements_path + '.last', errors='ignore') or '{}') | from_yaml ).values() | flatten }}"
4545

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+
4677
- name: Ensure control node is in inventory
4778
hosts: all
4879
gather_facts: false

environments/site/tofu/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ variable "state_volume_provisioning" {
203203
validation {
204204
condition = contains(["manage", "attach"], var.state_volume_provisioning)
205205
error_message = <<-EOT
206-
home_volume_provisioning must be "manage" or "attach"
206+
state_volume_provisioning must be "manage" or "attach"
207207
EOT
208208
}
209209
}

0 commit comments

Comments
 (0)