Question

packer.io wont work with DO

Hello, I have been following the instructions for Packer.io here:

https://www.digitalocean.com/community/tutorials/how-to-install-and-get-started-with-packer-on-an-ubuntu-12-04-vps

I have not deviated from the directions that I know of. All of the example packer.io templates I have found have failed validation.

root@packer:~/packer# packer validate foo.json
Failed to parse template: Error parsing JSON: invalid character '"' after object key:value pair
At line 6, column 6 (offset 158):
    5:     "region": "NYC3"
    6:     "
           ^

Here is the code I used right from the sample (excluding my API key)

{
  "builders": [{
    "type": "digitalocean",
    "api_token": "YOUR API TOKEN",
    "region": "nyc3"
    "size": "512mb"
    "image": "ubuntu-14-04-x64"
  }],

  "provisioners": [{
    "type": "shell",
    "inline": [
      "sleep 30",
      "sudo apt-get update",
      "sudo apt-get install -y apache2"
    ]
  }]

}

Anyone have a working packer.io template I can try? Or know why I can not get past packer validation?

Regards, James


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Figured out my own answer. Added commas…

{
  "builders": [{
    "type": "digitalocean",
    "api_token": "dda94b82f63c0dc3fdfd81243bd61c3e5de125a054971926e02e34342ee7eead",
    "region": "NYC3",
    "size": "512mb",
    "image": "ubuntu-14-04-x64"
  }],

  "provisioners": [{
    "type": "shell",
    "inline": [
      "sleep 30",
      "sudo apt-get update",
      "sudo apt-get install -y apache2"
    ]
  }]

}

~