Closed curiositycasualty closed 4 years ago
This is a cool idea, and I think it actually falls in line with some of the thinking we've been doing around what Packer 2.0 will look like. I think it's unlikely that we'll be getting to it any time in the next year though.
Hello there ! With HCL2 it is now possible to have tags variable and reuse these tags in sources:
variable "my_tags" {
default = {
A = "bunch"
Of = "tags
}
}
source "amazon-ebs" "example" {
# config
}
build {
source "amazon-ebs.example" {
name = "alpha-aws"
tags = var.tags
}
source "amazon-ebs.example" {
name = "beta-aws"
tags = var.tags
}
# ... provision
}
Closing this issue as it should just work, cheers ! 🎉
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
This would be a feature whereby a single builder could define multiple, similar builds by housing a comma-separated list (or JSON array) of build names in that builder's
name
property:Or even:
... "name": ["alpha-aws", "beta-aws"] ...
Such that both of the two builds would share the
tags
property.Customizing specifics of these builds could be accomplished through the user of the
override
property (assuming that functionality would be added forbuilders
):