Skip to content

Commit 3c7e8fd

Browse files
committed
gen_tfvars: add default for Azure accelerated networking variable
The Ansible template terraform.tfvars.j2 fails with an undefined variable error when generating Azure terraform configuration: AnsibleUndefinedVariable: 'terraform_azure_accelerated_networking_enabled' is undefined This occurs because the Kconfig variable TERRAFORM_AZURE_ACCELERATED_NETWORKING_ENABLED is a hidden bool (no user prompt) that uses conditional defaults based on VM size. When a VM size like Standard_B2s is selected, the variable defaults to 'n' via the condition "default n if TERRAFORM_AZURE_VM_SIZE_STANDARD_B2S". Kconfig's "output yaml" mechanism only writes variables to the yaml output file when they are explicitly set in .config or when hidden bools evaluate to 'y'. Hidden bools that evaluate to 'n' through conditional defaults are never written to the yaml output, leaving the Ansible variable undefined at template render time. The kernel-builder defconfig works because it explicitly sets the variable to 'y', which causes Kconfig to write it to the yaml. The nfsd-fstests defconfig relies on the conditional default, which evaluates to 'n' and is never output. Add a fallback default of 'false' in the gen_tfvars role defaults, following the existing pattern used for AWS variables. This ensures the variable is always defined regardless of whether Kconfig outputs it. Generated-by: Claude AI Signed-off-by: Chuck Lever <[email protected]>
1 parent a68e50e commit 3c7e8fd

File tree

1 file changed

+4
-0
lines changed
  • playbooks/roles/gen_tfvars/defaults

1 file changed

+4
-0
lines changed

playbooks/roles/gen_tfvars/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ terraform_aws_ebs_volumes_per_instance: "0"
2828
terraform_aws_ebs_volume_size: 0
2929
terraform_aws_ebs_volume_type: "gp3"
3030

31+
# Azure defaults - prevent undefined variable errors for hidden bool configs
32+
# that default to 'n' (kconfig doesn't output these to yaml)
33+
terraform_azure_accelerated_networking_enabled: false
34+
3135
terraform_oci_assign_public_ip: false
3236
terraform_oci_use_existing_vcn: false
3337

0 commit comments

Comments
 (0)