vagrant-cloud post-processor not working as expected

38 views
Skip to first unread message

Ashwin Balakrishnan

unread,
Nov 4, 2019, 7:54:21 AM11/4/19
to Packer
Hello team,

I have been trying to set up an in-house repository for vagrant boxes. However, have comes across some issues.
I am using the packer's vagrant-cloud post-processor for uploading the box file to our Artifactory server hosted in house.
  "post-processors": [
    [
        {
          "type": "vagrant",
          "output": "ubuntu-16.box",
          "only": ["virtualbox"]
        },
        {
          "type": "vagrant-cloud",
          "vagrant_cloud_url": "http://xyz/artifactory/api/vagrant/packer-virtualboxes",
          "access_token": "champa",
          "version": "{{user `image_version`}}",
          "box_tag": "ubuntu16"
        }
    ]

The packer process fails with 404 for the following:
2019/11/01 16:59:09 packer: 2019/11/01 16:59:09 Post-Processor Vagrant Cloud API GET: http://xyz/artifactory/api/vagrant/packer-virtualboxes/box/ubuntu16?access_token=ACCESS_TOKEN

The actual URL listed under "vagrant_cloud_url" in packer.json is "http://xyz/artifactory/api/vagrant/packer-virtualboxes".
However, when the packer build runs it tries to do a GET call on http://xyz/artifactory/api/vagrant/packer-virtualboxes/box/ubuntu16.
Not sure why *box* keyword is added after the actual url due to which the query fails.
I tried to do a curl call on http://xyz/artifactory/api/vagrant/packer-virtualboxes/ubuntu16 which works fine.


There is another problem with access_token.
The documentation says no need for access_token when *vagrant_cloud_url* is hosted in-house but the packer build fails complaining about access_token.

Megan Marsh

unread,
Nov 4, 2019, 12:12:20 PM11/4/19
to packe...@googlegroups.com
What version of Packer are you using? access_token was required for all runs, including in-house ones, until v1.4.4. so if you're using a verson of Packer older than that, it will complain. 

I can look into the box keyword issue if you open an issue on Packer's github repo :)

Ashwin Balakrishnan

unread,
Nov 5, 2019, 1:36:35 AM11/5/19
to Packer
Ahh okay, we are using an old version of packer i:e 1.1.1
That answers the access_token parameter problem.
For the *box* keyword, let me check once with the upgraded version of the packer.
If the issue persists will raise an issue :)

Ashwin Balakrishnan

unread,
Nov 5, 2019, 9:42:24 AM11/5/19
to Packer
After updating packer to 1.4.5, the issue with access_token has solved.
However, the box keyword issue still stays.
Raised an issue on Packer's GitHub repo --> https://github.com/hashicorp/packer/issues/8327
Reply all
Reply to author
Forward
Message has been deleted
0 new messages