Skip to content

Commit 00384ff

Browse files
committed
fix instance_id in compute inventory to be target image, not deployed image
1 parent fb255b2 commit 00384ff

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

environments/skeleton/{{cookiecutter.environment}}/tofu/inventory.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ ${cluster_name}_${group_name}:
3838
${ node.name }:
3939
ansible_host: ${node.access_ip_v4}
4040
instance_id: ${ node.id }
41-
image_id: ${ node.image_id }
4241
%{ endfor ~}
42+
vars:
43+
# NB: this is the target image, not necessarily what is provisioned
44+
image_id: ${compute_groups[group_name]["image_id"]}
4345
%{ endfor ~}
4446

4547
compute:

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,7 @@ resource "openstack_compute_instance_v2" "compute" {
144144
output "compute_instances" {
145145
value = local.compute_instances
146146
}
147+
148+
output "image_id" {
149+
value = var.image_id
150+
}

0 commit comments

Comments
 (0)