Skip to content

Commit 30c0cda

Browse files
committed
refine docs
1 parent fd043ab commit 30c0cda

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

docs/experimental/compute-init.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,15 @@ See the role README.md
44

55
# Changes to image / tofu state
66

7-
When a compute group has ignore_image_changes set as true in a compute group
8-
partition within tofu/main.tf, and the image is updated:
9-
10-
Subsequent changes to the tf cluster_image variable for that compute group don’t
11-
actually result in a change via tofu plan/apply. This is done with the
12-
lifecycle meta-argument "ignore_changes" in the compute resource.
13-
14-
As part of compute-init, the image_id is templated out to hostvars so that
15-
ansible will have image_id for each compute node.
16-
17-
WIP: Attempts to change the cluster image from tofu then act as a target
18-
for compute-init to read and rebuild to via slurm control.
7+
When a compute group has the `ignore_image_changes` parameter set to true,
8+
changes to the `image_id` parameter (which defaults to `cluster_image_id`) are
9+
ignored by OpenTofu.
10+
11+
Regardless of whether `ignore_image_changes` is set, OpenTofu templates out the
12+
`image_id` into the Ansible inventory for each compute node. The `compute_init`
13+
role templates out hostvars to the control node, which means the "target" image
14+
ID is then available on the control node. Subsequent work will use this to
15+
rebuild the node via slurm.
1916

2017
# CI workflow
2118

environments/skeleton/{{cookiecutter.environment}}/tofu/compute/nodes.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
9393

9494
lifecycle {
9595
ignore_changes = [
96-
image_id,
96+
image_id,
9797
]
9898
}
9999

environments/skeleton/{{cookiecutter.environment}}/tofu/compute/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ variable "compute_init_enable" {
9797

9898
variable "ignore_image_changes" {
9999
type = bool
100-
description = "Whether to prevent tofu from applying changes to the cluster image"
100+
description = "Whether to ignore changes to the image_id parameter"
101101
default = false
102102
}

environments/skeleton/{{cookiecutter.environment}}/tofu/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ variable "compute" {
5353
vnic_type: Overrides variable vnic_type
5454
vnic_profile: Overrides variable vnic_profile
5555
compute_init_enable: Toggles compute-init rebuild (see compute-init role docs)
56+
ignore_image_changes: ignore changes to the image_id parameter (see docs/experimental/compute-init.md)
5657
volume_backed_instances: Overrides variable volume_backed_instances
5758
root_volume_size: Overrides variable root_volume_size
5859
extra_volumes: Mapping defining additional volumes to create and attach

0 commit comments

Comments
 (0)