hashicorp / packer-plugin-vagrant

Packer plugin for Vagrant
https://packer.io
Mozilla Public License 2.0
13 stars 24 forks source link

Architecture support (vagrant-cloud post-processor) #101

Closed chrisroberts closed 9 months ago

chrisroberts commented 9 months ago

Adds architecture support to the vagrant and the vagrant-cloud post-processors.

Vagrant post-processor

Introduces a new configuration option to the vagrant post-processor:

This is an optional value that will automatically default to the host platform's architecture. The architecture value will be included within the metadata.json file of the generated box.

Also included with this changeset is support for the file builder. This was just done to make it easier for testing generated boxes.

Vagrant Cloud post-processor

Updates the API calls to use Vagrant Cloud's v2 API. The v2 API supports architecture metadata for providers and the post-processor has been updated to include architecture information. New configurations options added:

By default, the post-processor will read the architecture information from the metadata.json within the box. If the box metadata does not include architecture information, or the architecture needs to be overridden for some reason, it can be defined using the architecture configuration option.

The default_architecture option is used for backwards compatibility support (more information available in the Vagrant Cloud docs). If the architecture value set in default_architecture matches the architecture of the box then it will be marked as the default architecture on Vagrant Cloud.

Also adjusted the vagrant-cloud post-processor test so the artifact's IdValue matches the defined box's provider to provide a bit more clarity on the mocked API paths.