Also if you set DIGITALOCEAN_API_TOKEN packer will use that. I.e. export DIGITALOCEAN_API_TOKEN=$DO_API_TOKEN
If that doesn't work it would be good I'd you attach a log from PACKER_LOG=1 packer build template.json, just redact all sensitive information. On Feb 25, 2017 5:27 PM, "Alvaro Miranda Aguilera" <[email protected]> wrote: > hello > > not sure what is your host os, but in bash for linux/osx the single quote > will avoid the variable expansion > > try > packer build -var "do_api_token=${DO_API_TOKEN}" example.json > > On Sat, Feb 25, 2017 at 5:12 PM, Michael Beigelmacher < > [email protected]> wrote: > >> I’m going the tutorial on Packer here about parallel builds >> <https://www.packer.io/intro/getting-started/parallel-builds.html> and >> the build for a DigitalOcean image fails. First, packer validate >> example.json fails with: >> >> Template validation failed. Errors are shown below. >> >> Errors validating build 'digitalocean'. 1 error(s) occurred: >> >> * api_token for auth must be specified >> >> Which I worked around by running packer validate -var >> 'do_api_token=$DO_API_TOKEN' example.json which passed. More >> importantly, when I run packer build -var 'do_api_token=$DO_API_TOKEN' >> example.json I get the following error for DigitalOcean >> >> --> digitalocean: Error creating temporary SSH key: POST >> https://api.digitalocean.com/v2/account/keys: 401 Unable to authenticate you. >> >> I know my DO_API_TOKEN environment variable is correct as it works with >> other tools (Ansible) without a problem. >> >> >> -- >> This mailing list is governed under the HashiCorp Community Guidelines - >> https://www.hashicorp.com/community-guidelines.html. Behavior in >> violation of those guidelines may result in your removal from this mailing >> list. >> >> GitHub Issues: https://github.com/mitchellh/packer/issues >> IRC: #packer-tool on Freenode >> --- >> You received this message because you are subscribed to the Google Groups >> "Packer" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/packer-tool/20d846ac-d7cb-41bc-ab87-52cf29669057%40googlegroups.com >> <https://groups.google.com/d/msgid/packer-tool/20d846ac-d7cb-41bc-ab87-52cf29669057%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Alvaro > > -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/packer-tool/CAHqq0ez2do69AAZKMv1Zosyk0W_E_JQO%3Dy1Q63-9Ym5YUxjqOA% > 40mail.gmail.com > <https://groups.google.com/d/msgid/packer-tool/CAHqq0ez2do69AAZKMv1Zosyk0W_E_JQO%3Dy1Q63-9Ym5YUxjqOA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CALz9Rt8m%2BQNi%3DX3gAt0hyyWYjNf_LW-oKkBp_8PzeHjK5sMcdg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
