By ritsbusiness
Hello, I have been following the instructions for Packer.io here:
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
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!
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"
]
}]
}
~
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.