Skip to content

Instantly share code, notes, and snippets.

@mlabouardy
Created January 5, 2019 13:34
Show Gist options
  • Save mlabouardy/67a76b6959020c1ef9de564bb6f7d505 to your computer and use it in GitHub Desktop.
Save mlabouardy/67a76b6959020c1ef9de564bb6f7d505 to your computer and use it in GitHub Desktop.
Packer template to bake Nexus GCP image
{
"variables" : {
"zone" : "YOUR ZONE",
"project" : "YOUR PROJECT ID",
"source_image" : "centos-7-v20181210",
"ssh_username" : "packer",
"credentials_path" : "PATH/account.json"
},
"builders" : [
{
"type": "googlecompute",
"account_file": "{{user `credentials_path`}}",
"project_id": "{{user `project`}}",
"source_image": "{{user `source_image`}}",
"ssh_username": "{{user `ssh_username`}}",
"zone": "{{user `zone`}}",
"image_name" : "nexus-v3-14-0-04"
}
],
"provisioners" : [
{
"type" : "file",
"source" : "./nexus.rc",
"destination" : "/tmp/nexus.rc"
},
{
"type" : "file",
"source" : "./repository.json",
"destination" : "/tmp/repository.json"
},
{
"type" : "shell",
"script" : "./setup.sh",
"execute_command" : "sudo -E -S sh '{{ .Path }}'"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment