{
  "builders": [
    {
      "boot_wait": "{{user `boot_wait`}}",
      "communicator": "winrm",
      "cpus": "{{user `cpu`}}",
      "disk_size": "{{user `disk_size`}}",
      "floppy_files": [
        "./packer/vbox/windows/{{user `build_name`}}/autounattend.xml",
        "./packer/vbox/windows/enable-winrm.ps1",
        "./packer/vbox/windows/sysprep.ps1"
      ],
      "guest_additions_mode": "disable",
      "guest_os_type": "{{user `local_guest_os_type`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_urls": [
        "{{user `os_iso_url`}}"
      ],
      "memory": "{{user `memory`}}",
      "name": "virtualbox-iso",
      "output_directory": "{{user `output_dir`}}",
      "shutdown_command": "powershell A:/sysprep.ps1",
      "shutdown_timeout": "1h",
      "type": "virtualbox-iso",
      "vm_name": "{{user `build_version`}}",
      "winrm_password": "S3cr3t0!",
      "winrm_timeout": "4h",
      "winrm_username": "Administrator"
    }
  ],
  "post-processors": [
    {
      "keep_input_artifact": true,
      "output": "./output/windows-2019.box",
      "type": "vagrant",
      "vagrantfile_template": "./packer/vbox/vagrantfile-windows_2019.template"
    }
  ],
  "provisioners": [
    {
      "extra_arguments": [
        "-e",
        "ansible_winrm_scheme=http",
        "--extra-vars",
        "{{user `ansible_common_vars`}}",
        "--extra-vars",
        "{{user `ansible_extra_vars`}}",
        "--extra-vars",
        "{{user `ansible_user_vars`}}"
      ],
      "playbook_file": "ansible/windows/node_windows.yml",
      "type": "ansible",
      "use_proxy": false,
      "user": "Administrator"
    },
    {
      "restart_check_command": "powershell -command \"& {if ((get-content C:\\ProgramData\\lastboot.txt) -eq (Get-WmiObject win32_operatingsystem).LastBootUpTime) {Write-Output 'Sleeping for 600 seconds to wait for reboot'; start-sleep 600} else {Write-Output 'Reboot complete'}}\"",
      "restart_command": "powershell \"& {(Get-WmiObject win32_operatingsystem).LastBootUpTime > C:\\ProgramData\\lastboot.txt; Restart-Computer -force}\"",
      "type": "windows-restart"
    },
    {
      "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`}}",
      "target_os": "Windows",
      "tests": [
        "{{user `goss_tests_dir`}}"
      ],
      "type": "goss",
      "url": "{{user `goss_url`}}",
      "use_sudo": false,
      "vars_env": {
        "GOSS_MAX_CONCURRENT": "1",
        "GOSS_USE_ALPHA": "1"
      },
      "vars_file": "{{user `goss_vars_file`}}",
      "vars_inline": {
        "OS": "{{user `distro_name` | lower}}",
        "PROVIDER": "virtualbox",
        "containerd_version": "{{user `containerd_version`}}",
        "distribution_version": "{{user `distro_version`}}",
        "docker_ee_version": "{{user `docker_ee_version`}}",
        "kubernetes_version": "{{user `kubernetes_semver`}}",
        "pause_image": "{{user `pause_image`}}",
        "runtime": "{{user `runtime`}}",
        "ssh_source_url": "{{user `ssh_source_url`}}"
      },
      "version": "{{user `goss_version`}}"
    }
  ],
  "variables": {
    "ansible_common_vars": "",
    "ansible_extra_vars": "",
    "ansible_user_vars": "",
    "build_name": null,
    "build_timestamp": "{{timestamp}}",
    "build_version": "{{user `build_name`}}-kube-{{user `kubernetes_semver`}}",
    "cloudbase_init_url": "https://github.com/cloudbase/cloudbase-init/releases/download/{{user `cloudbase_init_version`}}/CloudbaseInitSetup_{{user `cloudbase_init_version` | replace_all `.` `_` }}_x64.msi",
    "cloudbase_plugins": "cloudbaseinit.plugins.windows.createuser.CreateUserPlugin, cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin, cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin, cloudbaseinit.plugins.common.ephemeraldisk.EphemeralDiskPlugin, cloudbaseinit.plugins.common.mtu.MTUPlugin, cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,  cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin, cloudbaseinit.plugins.common.userdata.UserDataPlugin, cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin, cloudbaseinit.plugins.windows.createuser.CreateUserPlugin, cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin",
    "cloudbase_plugins_unattend": "cloudbaseinit.plugins.common.mtu.MTUPlugin",
    "containerd_sha256": null,
    "containerd_url": "",
    "containerd_version": null,
    "disable_hypervisor": null,
    "disk_size": "81920",
    "ib_version": "{{env `IB_VERSION`}}",
    "kubernetes_base_url": "https://kubernetesreleases.blob.core.windows.net/kubernetes/{{user `kubernetes_semver`}}/binaries/node/windows/{{user `kubernetes_goarch`}}",
    "kubernetes_http_package_url": "",
    "kubernetes_typed_version": "kube-{{user `kubernetes_semver`}}",
    "manifest_output": "manifest.json",
    "netbios_host_name_compatibility": null,
    "nssm_url": null,
    "output_dir": "./output/{{user `build_version`}}",
    "prepull": null,
    "windows_service_manager": null,
    "windows_updates_categories": null,
    "windows_updates_kbs": null
  }
}