=========================================================
"post-processors": [
{
"type": "shell-local",
"script": "create-cloudbox.sh"
},
{
"output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box",
"type": "vagrant"
},
{
"type": "vagrant-cloud",
"box_tag": "username/nameofmybox",
"access_token": "{{user `cloud_token`}}",
"version": "{{user `version`}}"
}
],======================================================================================================
So it seems that I don have to precreate the box through the webinterface or have to use the API ....
"post-processors": [[
{"output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box","type": "vagrant"},{"type": "vagrant-cloud",
"box_tag": "myusername/test13",
"access_token": "{{user `cloud_token`}}","version": "{{user `version`}}"}]],
I exported access_token=foo
sudo packer build -only=vmware-iso ubuntu-20.04-amd64.json
* access_token must be set if vagrant_cloud_url has not been overriden* Failed to verify authentication token: 401 Unauthorized
The first example you should should have worked. Are you sure the env var VAGRANT_CLOUD_TOKEN is set?
Op donderdag 14 mei 2020 20:52:15 UTC+2 schreef Megan Marsh:The first example you should should have worked. Are you sure the env var VAGRANT_CLOUD_TOKEN is set?
Yes. I can echo it. I went back to the first example and it doesn give me the error any more .. *confused* I need to protect myself with a verioncontrol system I guess. Its building. Fingers crossed ...
"post-processors": [
{
"type": "shell-local",
"script": "create-cloudbox.sh"
},
{
"output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box",
"type": "vagrant"
},
{
"type": "vagrant-cloud",
"box_tag": "username/nameofmybox",
"access_token": "{{user `cloud_token`}}",
"version": "{{user `version`}}"
}
],
"post-processors": [[
{
"type": "shell-local",
"script": "create-cloudbox.sh"
},
{
"output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box",
"type": "vagrant"
},
{
"type": "vagrant-cloud",
"box_tag": "username/nameofmybox",
"access_token": "{{user `cloud_token`}}",
"version": "{{user `version`}}"
}
]],
"post-processors": [[
{
"type": "shell-local",
"script": "create-cloudbox.sh"
},
{
"output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box",
"type": "vagrant"
},
{
"type": "vagrant-cloud",
"box_tag": "username/nameofmybox",
"access_token": "{{user `cloud_token`}}",
"version": "{{user `version`}}"
}
]],
In the documentation: https://www.packer.io/docs/post-processors/vagrant-cloud/
Thi is from
This is from the Packer documentation: https://www.packer.io/docs/post-processors/vagrant-cloud/#use-with-the-vagrant-post-processor{"variables": {"cloud_token": "{{ env `VAGRANT_CLOUD_TOKEN` }}","version": "1.0.{{timestamp}}"},
"post-processors": [{"type": "shell-local","inline": ["echo Doing stuff..."]},[{"type": "vagrant","include": ["image.iso"],"vagrantfile_template": "vagrantfile.tpl","output": "proxycore_{{.Provider}}.box"},{"type": "vagrant-cloud","box_tag": "hashicorp/precise64","access_token": "{{user `cloud_token`}}","version": "{{user `version`}}"}]]}
From what I can see you grabbed a template that is setup to publish to Vagrant Cloud, this requires an account there and I believe requires a subscription if you aren't hosting the boxes on your own infrastructure. If you have an account there you should be able to generate a token in your account settings and pass it on as a `-var` or put it in a JSON file and pass that as a `-var-file`.
If you don't need this functionality you should delete the line under variables referencing Vagrant Cloud and also any section in post processors that contains a reference to that variable.