Example and docs

This commit is contained in:
2025-04-22 15:42:18 +02:00
parent a783782187
commit 699d910895
7 changed files with 71 additions and 17 deletions

View File

@@ -1,12 +1,15 @@
locals {
packer_variables_file = "variables.pkrvars.hcl"
packer_variables = <<-EOT
%{ for key, value in var.packer_variables ~}
${key} = ${try(jsonencode(value), "\"${value}\"")}
%{ endfor ~}
EOT
}
resource "local_file" "packer_variables" {
filename = local.packer_variables_file
content = <<-EOT
scripts = ${jsonencode(var.provisioning_scripts)}
EOT
content = local.packer_variables
}
resource "docker_image" "packer" {