You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/command/test-fixtures/hcl/data-source-validation.pkr.hcl

40 lines
750 B

data "null" "secret" {
input = "s3cr3t"
}
locals {
secret = data.null.secret.output
}
source "file" "foo" {
content = "foo"
target = "foo.txt"
}
build {
sources = ["file.foo"]
provisioner "shell-local" {
only_on = ["darwin", "freebsd", "linux", "openbsd", "solaris"]
# original bug in :
# environment_vars = ["MY_SECRET=${local.secret}"]
env = {
"MY_SECRET":"${local.secret}",
}
inline = [
"echo yo, my secret is $MY_SECRET",
"echo '' > $MY_SECRET",
]
}
provisioner "shell-local" {
only_on = ["windows"]
env = {
"MY_SECRET":"${local.secret}",
}
inline = [
"echo yo, my secret is %MY_SECRET%",
"echo '' > %MY_SECRET%",
]
}
}