demo/digitalocean: basic packer build works

This commit is contained in:
Ryan Uber 2015-09-23 13:03:57 -07:00
parent 98d3fc3b42
commit a0305f2689
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,37 @@
{
"variables": {
"role": "{{ env `NOMAD_ROLE` }}",
"bin_url": "{{ env `NOMAD_URL` }}"
},
"builders": [
{
"type": "digitalocean",
"image": "ubuntu-12-04-x64",
"region": "nyc3",
"size": "512mb"
}
],
"provisioners": [
{
"type": "file",
"source": "nomad.zip",
"destination": "/tmp/nomad.zip"
},
{
"type": "shell",
"inline": [
"sudo apt-get -y update",
"sudo apt-get -y install unzip",
"# Temporarily disabled until public release. Uncomment",
"# and remove the above file provisioner.",
"#curl -o /tmp/nomad.zip -L {{ user `bin_url` }}",
"sudo unzip -d /usr/local/bin /tmp/nomad.zip"
]
},
{
"type": "file",
"source": "upstart.nomad",
"destination": "/etc/init/nomad"
}
]
}

View File

@ -0,0 +1,10 @@
description "Nomad by HashiCorp"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
exec /usr/local/bin/nomad -config /usr/local/etc/nomad.hcl >> /var/log/nomad.log 2>&1
end script