The min_packer_version
key could specify the minimum Packer version for a template in JSON. This does not seem to be currently supported in HCL syntax. Since this seems more like functional metadata, I am not sure where eventually it should ideally be specified.
packer build
1.5.6
source "source" "name" {
min_packer_version = "1.5.6"
}
or
build {
min_packer_version = "1.5.6"
}
Ubuntu 18.04
Error: Unsupported argument
...
An argument named "min_packer_version" is not expected here.
Hey @mschuchard ! Thanks for opening ! I'll make sure to add this to the TODO 🙂. After some thinking I'm thinking of allowing to set this per hcl file at the top-level, for example:
min_packer_version = "1.5.6"
build {
# ....
}
We would simply check this value if it's set and error/not read the file in case.
Update here, I think this should be in a packer block:
packer {
required_version = ">= 1.2.0, < 2.0.0" // < some selector
}
Thank you for expanding upon the original ask, and including the semantic version operator ~>
in the expansion.
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.
Most helpful comment
Update here, I think this should be in a packer block: