Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

ubuntu gcp packer

{
  "builders": [
    {
      "type": "googlecompute",
      "project_id": "<your project ID that will be used to launch instances and store images>",
      "source_image_project_id": "ubuntu-os-pro-cloud",
      "source_image_family": "ubuntu-pro-1804-lts",
      "zone": "us-central1-a",
      "image_description": "created-with-packer",
      "ssh_username": "root",
      "tags": "packer",
      "account_file": "<your google credentials in json format>"
    }
  ],
  "provisioners": [
    {
      "type": "shell",
      "inline": [
        "sudo ua status --wait",
        "sudo ua detach --assume-yes"
      ]
    }
  ]
}
Source by davecore82.github.io #
 
PREVIOUS NEXT
Tagged: #ubuntu #gcp #packer
ADD COMMENT
Topic
Name
1+7 =