Permalink
Switch branches/tags
Nothing to show
Find file Copy path
a32427d Apr 3, 2018
1 contributor

Users who have contributed to this file

42 lines (41 sloc) 1005 Bytes
{
"variables": {
"source_image_family": "var",
"machine_type": "var",
"region": "var",
"zone": "var",
"project_id": "var",
"service_account_json": "var"
},
"builders": [
{
"type": "googlecompute",
"project_id": "{{user `project_id`}}",
"machine_type": "{{user `machine_type`}}",
"source_image_family": "{{user `source_image_family`}}",
"region": "{{user `region`}}",
"zone": "{{user `zone`}}",
"image_description": "Demo Ubuntu Machine Image",
"image_name": "u16demo-{{timestamp}}",
"disk_size": 16,
"disk_type": "pd-ssd",
"ssh_username": "root",
"account_file": "{{ user `service_account_json`}}"
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"sleep 10",
"uname -a",
"uptime"
]
},
{
"type": "shell",
"script": "init.sh",
"execute_command": "echo 'packer' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
}
]
}