Last active
March 18, 2020 02:20
-
-
Save robzr/01a3a4da52bd85342528fc9a7c8246ab to your computer and use it in GitHub Desktop.
Packer HCL file demonstrating local variable reference issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "test" { | |
default = "default value" # Remove this line to cause Packer to crash | |
} | |
locals { | |
test = var.test | |
} | |
source "null" "null" { | |
communicator = "none" | |
} | |
build { | |
sources = ["source.null.null"] | |
provisioner "shell-local" { | |
command = "echo var.test=\"${var.test}\" local.test=\"${local.test}\"" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment