2014-06-25 11:44:08 -04:00
|
|
|
---
|
2015-07-22 22:31:00 -04:00
|
|
|
layout: docs
|
2017-03-25 18:13:52 -04:00
|
|
|
sidebar_current: docs-post-processors-vagrant-cloud
|
|
|
|
page_title: Vagrant Cloud - Post-Processors
|
|
|
|
description: |-
|
|
|
|
The Packer Vagrant Cloud post-processor receives a Vagrant box from the
|
|
|
|
`vagrant` post-processor and pushes it to Vagrant Cloud. Vagrant Cloud hosts
|
|
|
|
and serves boxes to Vagrant, allowing you to version and distribute boxes to
|
|
|
|
an organization in a simple way.
|
|
|
|
---
|
2014-06-25 11:44:08 -04:00
|
|
|
|
|
|
|
# Vagrant Cloud Post-Processor
|
|
|
|
|
|
|
|
Type: `vagrant-cloud`
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The Packer Vagrant Cloud post-processor receives a Vagrant box from the
|
|
|
|
`vagrant` post-processor and pushes it to Vagrant Cloud. [Vagrant
|
2016-01-14 15:33:00 -05:00
|
|
|
Cloud](https://atlas.hashicorp.com) hosts and serves boxes to Vagrant, allowing you
|
2015-07-22 22:31:00 -04:00
|
|
|
to version and distribute boxes to an organization in a simple way.
|
2014-06-25 11:44:08 -04:00
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
You'll need to be familiar with Vagrant Cloud, have an upgraded account to
|
|
|
|
enable box hosting, and be distributing your box via the [shorthand
|
2016-01-14 15:31:19 -05:00
|
|
|
name](https://docs.vagrantup.com/v2/cli/box.html) configuration.
|
2014-06-25 11:44:08 -04:00
|
|
|
|
|
|
|
## Workflow
|
|
|
|
|
|
|
|
It's important to understand the workflow that using this post-processor
|
|
|
|
enforces in order to take full advantage of Vagrant and Vagrant Cloud.
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The use of this processor assume that you currently distribute, or plan to
|
|
|
|
distribute, boxes via Vagrant Cloud. It also assumes you create Vagrant Boxes
|
|
|
|
and deliver them to your team in some fashion.
|
2014-06-25 11:44:08 -04:00
|
|
|
|
|
|
|
Here is an example workflow:
|
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
1. You use Packer to build a Vagrant Box for the `virtualbox` provider
|
|
|
|
1. The `vagrant-cloud` post-processor is configured to point to the box
|
|
|
|
`hashicorp/foobar` on Vagrant Cloud via the `box_tag` configuration
|
|
|
|
1. The post-processor receives the box from the `vagrant` post-processor
|
|
|
|
1. It then creates the configured version, or verifies the existence of it, on
|
|
|
|
Vagrant Cloud
|
|
|
|
1. A provider matching the name of the Vagrant provider is then created
|
|
|
|
1. The box is uploaded to Vagrant Cloud
|
|
|
|
1. The upload is verified
|
|
|
|
1. The version is released and available to users of the box
|
2014-06-25 11:44:08 -04:00
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
2015-07-22 22:31:00 -04:00
|
|
|
The configuration allows you to specify the target box that you have access to
|
|
|
|
on Vagrant Cloud, as well as authentication and version information.
|
2014-06-25 11:44:08 -04:00
|
|
|
|
|
|
|
### Required:
|
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
- `access_token` (string) - Your access token for the Vagrant Cloud API. This
|
2015-07-22 23:25:58 -04:00
|
|
|
can be generated on your [tokens
|
|
|
|
page](https://vagrantcloud.com/account/tokens).
|
2014-06-25 11:44:08 -04:00
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
- `box_tag` (string) - The shorthand tag for your box that maps to Vagrant
|
2015-07-22 23:25:58 -04:00
|
|
|
Cloud, i.e `hashicorp/precise64` for `vagrantcloud.com/hashicorp/precise64`
|
2014-06-25 11:44:08 -04:00
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
- `version` (string) - The version number, typically incrementing a
|
2015-07-22 23:25:58 -04:00
|
|
|
previous version. The version string is validated based on [Semantic
|
|
|
|
Versioning](http://semver.org/). The string must match a pattern that could
|
|
|
|
be semver, and doesn't validate that the version comes after your
|
|
|
|
previous versions.
|
2014-06-25 11:44:08 -04:00
|
|
|
|
|
|
|
### Optional:
|
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
- `no_release` (string) - If set to true, does not release the version on
|
2015-07-22 23:25:58 -04:00
|
|
|
Vagrant Cloud, making it active. You can manually release the version via
|
|
|
|
the API or Web UI. Defaults to false.
|
2014-06-25 11:44:08 -04:00
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
- `vagrant_cloud_url` (string) - Override the base URL for Vagrant Cloud. This
|
2015-07-22 23:25:58 -04:00
|
|
|
is useful if you're using Vagrant Private Cloud in your own network.
|
|
|
|
Defaults to `https://vagrantcloud.com/api/v1`
|
2014-06-25 11:44:08 -04:00
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
- `version_description` (string) - Optionally markdown text used as a
|
2015-07-22 23:25:58 -04:00
|
|
|
full-length and in-depth description of the version, typically for denoting
|
|
|
|
changes introduced
|
2014-07-11 09:21:16 -04:00
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
- `box_download_url` (string) - Optional URL for a self-hosted box. If this is
|
2015-07-22 23:25:58 -04:00
|
|
|
set the box will not be uploaded to the Vagrant Cloud.
|
2014-08-02 09:14:29 -04:00
|
|
|
|
2014-06-25 11:44:08 -04:00
|
|
|
## Use with Vagrant Post-Processor
|
|
|
|
|
|
|
|
You'll need to use the Vagrant post-processor before using this post-processor.
|
2015-03-24 15:41:17 -04:00
|
|
|
An example configuration is below. Note the use of a doubly-nested array, which
|
|
|
|
ensures that the Vagrant Cloud post-processor is run after the Vagrant
|
|
|
|
post-processor.
|
2014-06-25 11:44:08 -04:00
|
|
|
|
2017-03-25 18:13:52 -04:00
|
|
|
```json
|
2014-06-25 11:44:08 -04:00
|
|
|
{
|
2015-03-24 15:41:17 -04:00
|
|
|
"variables": {
|
2017-06-06 17:51:35 -04:00
|
|
|
"cloud_token": "{{ env `ATLAS_TOKEN` }}"
|
2015-03-24 15:41:17 -04:00
|
|
|
},
|
|
|
|
"post-processors": [
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"type": "vagrant",
|
|
|
|
"include": ["image.iso"],
|
|
|
|
"vagrantfile_template": "vagrantfile.tpl",
|
|
|
|
"output": "proxycore_{{.Provider}}.box"
|
2014-06-25 11:44:08 -04:00
|
|
|
},
|
|
|
|
{
|
2015-03-24 15:41:17 -04:00
|
|
|
"type": "vagrant-cloud",
|
|
|
|
"box_tag": "hashicorp/precise64",
|
|
|
|
"access_token": "{{user `cloud_token`}}",
|
2017-06-06 17:51:35 -04:00
|
|
|
"version": "1.0.{{timestamp}}"
|
2015-03-24 15:41:17 -04:00
|
|
|
}
|
2014-06-25 11:44:08 -04:00
|
|
|
]
|
2015-03-24 15:41:17 -04:00
|
|
|
]
|
2014-06-25 11:44:08 -04:00
|
|
|
}
|
|
|
|
```
|