Skip to content

Commit d717a7a

Browse files
authored
Reformat compute_fixed_image user_data (#847)
When the additional_cloud_config support was added, newline characters were also added outside of the conditional block. This means compute_fixed_image instances would be shceduled for replacement on the next tofu apply. This breaks slurm controlled rebuilds, as these fixed nodes should not be replaced at this step. Correct this by moving the newlines to be within the conditional block. The double newline is presevred to avoid breaking systems which are already using both additional_cloud_config and slurm controlled rebuild.
1 parent adb62d0 commit d717a7a

File tree

1 file changed

+3
-3
lines changed
  • environments/site/tofu/node_group

1 file changed

+3
-3
lines changed

environments/site/tofu/node_group/nodes.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
134134

135135
user_data = <<-EOF
136136
#cloud-config
137-
fqdn: ${local.fqdns[each.key]}
137+
fqdn: ${local.fqdns[each.key]}%{if var.additional_cloud_config != ""}
138+
138139
139-
%{if var.additional_cloud_config != ""}
140140
${templatestring(var.additional_cloud_config, var.additional_cloud_config_vars)}
141141
%{endif}
142142
EOF
@@ -237,4 +237,4 @@ output "fqdns" {
237237

238238
output "nodegroup_fips" {
239239
value = local.nodegroup_fips
240-
}
240+
}

0 commit comments

Comments
 (0)