{
  "builders": [
    {
      "disable_default_service_account": "{{ user `disable_default_service_account` }}",
      "image_family": "{{user `image_family` | clean_resource_name}}",
      "image_name": "{{user `image_name` | clean_resource_name}}",
      "labels": {
        "build_timestamp": "{{user `build_timestamp`}}",
        "distribution": "ubuntu",
        "distribution_release": "{{user `distribution_release`}}",
        "distribution_version": "{{user `distribution_version`}}",
        "kubernetes_version": "{{user `kubernetes_semver` | clean_resource_name}}"
      },
      "machine_type": "{{ user `machine_type` }}",
      "name": "{{user `build_name`}}",
      "project_id": "{{ user `project_id` }}",
      "service_account_email": "{{ user `service_account_email` }}",
      "source_image_family": "{{ user `source_image_family` }}",
      "ssh_username": "ubuntu",
      "type": "googlecompute",
      "use_internal_ip": "{{ user `use_internal_ip`}}",
      "zone": "{{ user `zone` }}"
    }
  ],
  "provisioners": [
    {
      "environment_vars": [
        "BUILD_NAME={{user `build_name`}}"
      ],
      "inline": [
        "if [ $BUILD_NAME != \"ubuntu-1804\" ] || [ $BUILD_NAME != \"ubuntu-2004\" ]; then exit 0; fi",
        "while [ ! -f /var/lib/cloud/instance/boot-finished ]; do echo 'Waiting for cloud-init...'; sleep 1; done",
        "sudo apt-get -qq update && sudo DEBIAN_FRONTEND=noninteractive apt-get -qqy install python python-pip"
      ],
      "type": "shell"
    },
    {
      "ansible_env_vars": [
        "ANSIBLE_SSH_ARGS='{{user `existing_ansible_ssh_args`}} {{user `ansible_common_ssh_args`}}'"
      ],
      "extra_arguments": [
        "--extra-vars",
        "{{user `ansible_common_vars`}}",
        "--extra-vars",
        "{{user `ansible_extra_vars`}}",
        "--scp-extra-args",
        "{{user `ansible_scp_extra_args`}}"
      ],
      "playbook_file": "./ansible/node.yml",
      "type": "ansible"
    },
    {
      "arch": "{{user `goss_arch`}}",
      "download_path": "{{user `goss_download_path`}}",
      "format": "{{user `goss_format`}}",
      "format_options": "{{user `goss_format_options`}}",
      "goss_file": "{{user `goss_entry_file`}}",
      "inspect": "{{user `goss_inspect_mode`}}",
      "remote_folder": "{{user `goss_remote_folder`}}",
      "remote_path": "{{user `goss_remote_path`}}",
      "skip_install": "{{user `goss_skip_install`}}",
      "tests": [
        "{{user `goss_tests_dir`}}"
      ],
      "type": "goss",
      "url": "{{user `goss_url`}}",
      "use_sudo": true,
      "vars_file": "{{user `goss_vars_file`}}",
      "vars_inline": {
        "ARCH": "amd64",
        "OS": "ubuntu",
        "PROVIDER": "gcp",
        "containerd_version": "{{user `containerd_version`}}",
        "kubernetes_cni_deb_version": "{{ user `kubernetes_cni_deb_version` }}",
        "kubernetes_cni_rpm_version": "{{ split (user `kubernetes_cni_rpm_version`) \"-\" 0 }}",
        "kubernetes_cni_source_type": "{{user `kubernetes_cni_source_type`}}",
        "kubernetes_cni_version": "{{user `kubernetes_cni_semver` | replace \"v\" \"\" 1}}",
        "kubernetes_deb_version": "{{ user `kubernetes_deb_version` }}",
        "kubernetes_rpm_version": "{{ split (user `kubernetes_rpm_version`) \"-\" 0  }}",
        "kubernetes_source_type": "{{user `kubernetes_source_type`}}",
        "kubernetes_version": "{{user `kubernetes_semver` | replace \"v\" \"\" 1}}"
      },
      "version": "{{user `goss_version`}}"
    }
  ],
  "variables": {
    "ansible_common_vars": "",
    "ansible_extra_vars": "",
    "ansible_scp_extra_args": "",
    "build_timestamp": "{{timestamp}}",
    "containerd_sha256": null,
    "containerd_url": "https://github.com/containerd/containerd/releases/download/v{{user `containerd_version`}}/cri-containerd-cni-{{user `containerd_version`}}-linux-amd64.tar.gz",
    "containerd_version": null,
    "crictl_url": "https://github.com/kubernetes-sigs/cri-tools/releases/download/v{{user `crictl_version`}}/crictl-v{{user `crictl_version`}}-linux-amd64.tar.gz",
    "crictl_version": null,
    "disable_default_service_account": "",
    "encrypted": "false",
    "existing_ansible_ssh_args": "{{env `ANSIBLE_SSH_ARGS`}}",
    "image_family": "capi-{{user `build_name`}}-k8s-{{user `kubernetes_series`}}",
    "image_name": "cluster-api-{{user `build_name`}}-{{user `kubernetes_semver`}}-{{user `build_timestamp`}}",
    "kubernetes_cni_deb_version": null,
    "kubernetes_cni_http_source": null,
    "kubernetes_cni_rpm_version": null,
    "kubernetes_cni_semver": null,
    "kubernetes_cni_source_type": null,
    "kubernetes_container_registry": null,
    "kubernetes_deb_gpg_key": null,
    "kubernetes_deb_repo": null,
    "kubernetes_deb_version": null,
    "kubernetes_http_source": null,
    "kubernetes_load_additional_imgs": null,
    "kubernetes_rpm_gpg_check": null,
    "kubernetes_rpm_gpg_key": null,
    "kubernetes_rpm_repo": null,
    "kubernetes_rpm_version": null,
    "kubernetes_semver": null,
    "kubernetes_series": null,
    "kubernetes_source_type": null,
    "machine_type": "n1-standard-1",
    "project_id": "{{env `GCP_PROJECT_ID`}}",
    "service_account_email": "",
    "source_image_family": "{{user `build_name`}}-lts",
    "use_internal_ip": "false",
    "zone": null
  }
}