open-nomad/terraform/azure/packer.json

59 lines
1.5 KiB
JSON
Raw Normal View History

2017-11-01 21:07:13 +00:00
{
"variables": {
"azure_client_id": "{{ env `ARM_CLIENT_ID` }}",
"azure_client_secret": "{{ env `ARM_CLIENT_SECRET` }}",
"azure_subscription_id": "{{ env `ARM_SUBSCRIPTION_ID` }}",
"azure_resource_group": "{{ env `AZURE_RESOURCE_GROUP` }}"
},
"builders": [
{
"type": "azure-arm",
"client_id": "{{ user `azure_client_id` }}",
"client_secret": "{{ user `azure_client_secret` }}",
"subscription_id": "{{ user `azure_subscription_id` }}",
"managed_image_resource_group_name": "{{ user `azure_resource_group` }}",
"location": "East US",
"image_publisher": "Canonical",
"image_offer": "UbuntuServer",
"image_sku": "16.04-LTS",
"os_type": "Linux",
"ssh_username": "packer",
"managed_image_name": "hashistack",
2017-11-01 21:07:13 +00:00
"azure_tags": {
"Product": "Hashistack"
2017-11-01 21:07:13 +00:00
}
}],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo mkdir /ops",
"sudo chmod 777 /ops"
]
},
{
"type": "file",
"source": "../shared",
2017-11-01 21:07:13 +00:00
"destination": "/ops"
},
{
"type": "file",
"source": "../examples",
2017-11-01 21:07:13 +00:00
"destination": "/ops"
},
{
"type": "shell",
"script": "../shared/scripts/setup.sh"
2017-11-01 21:07:13 +00:00
},
{
"execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
"inline": [
"apt-get update -qq -y",
"apt-get upgrade -qq -y",
"/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
],
"inline_shebang": "/bin/sh -x",
"type": "shell"
}]
}