hashicorp / hashicorp/packer-plugin-vagrant
Vagrant builder: Update box if exists
- Dominant language
- Go
- Stars
- 16
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
_This issue was originally opened by @ndench as hashicorp/packer#10876. It was migrated here as a result of the [Packer plugin split](https://github.com/hashicorp/packer/issues/8610#issuecomment-770034737). The original body of the issue is below._
#### Community Note
Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request.
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
#### Description
When using the vagrant builder, I'd like to be able to specify something like `"box_update": true` to ensure that the build is always happening on the latest version of the source box. The ways of achieving this now are:
1. Use the `box_version` parameter -> this requires the user to check for the latest versions before every build and update their build file.
2. Use the `force_add` parameter -> this will cause packer to always download the box, even when there is no new version
3. Run `vagrant box update` manually before running packer
#### Use Case(s)
[Bento boxes](https://github.com/chef/bento) built by Chef, are very common base boxes and are update relatively regularly. By ensuring your build is on the latest version you will get the latest security patches.
You may also be building multiple vagrant boxes on top of each other (instead of using a third party base box). In which case, you likely want the latest version of your base box.
#### Potential configuration
```
{
"builders": [
{
"communicator": "ssh",
"source_path": "hashicorp/precise64",
"provider": "virtualbox",
"add_force": true,
"type": "vagrant",
"box_update": true
}
]
}
```
Contributor guide
Assessment
This issue has not been assessed yet.