{
  "builders": [
    {
      "boot_command": [
        "<esc><wait>",
        "<esc><wait>",
        "<enter><wait>",
        "/install/vmlinuz<wait>",
        " auto<wait>",
        " console-setup/ask_detect=false<wait>",
        " console-setup/layoutcode=us<wait>",
        " console-setup/modelcode=pc105<wait>",
        " debconf/frontend=noninteractive<wait>",
        " debian-installer=en_US.UTF-8<wait>",
        " fb=false<wait>",
        " initrd=/install/initrd.gz<wait>",
        " kbd-chooser/method=us<wait>",
        " keyboard-configuration/layout=USA<wait>",
        " keyboard-configuration/variant=USA<wait>",
        " locale=en_US.UTF-8<wait>",
        " netcfg/get_domain=vm<wait>",
        " netcfg/get_hostname=vagrant<wait>",
        " grub-installer/bootdev=/dev/sda<wait>",
        " noapic<wait>",
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}<wait>",
        " -- <wait>",
        "<enter><wait>"
      ],
      "boot_wait": "10s",
      "disk_size": "{{user `disk_size`}}",
      "guest_additions_url": "{{ user `guest_additions_url` }}",
      "guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
      "guest_os_type": "Ubuntu_64",
      "hard_drive_interface": "sata",
      "headless": "{{ user `headless` }}",
      "http_directory": "{{user `http_directory`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
      "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-virtualbox",
      "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_username": "vagrant",
      "ssh_timeout": "10000s",
      "type": "virtualbox-iso",
      "memory": "{{ user `memory` }}",
      "cpus": "{{ user `cpus` }}",
      "virtualbox_version_file": ".vbox_version",
      "vm_name": "{{ user `template` }}"
    },
    {
      "boot_command": [
        "<esc><wait>",
        "<esc><wait>",
        "<enter><wait>",
        "/install/vmlinuz<wait>",
        " auto<wait>",
        " console-setup/ask_detect=false<wait>",
        " console-setup/layoutcode=us<wait>",
        " console-setup/modelcode=pc105<wait>",
        " debconf/frontend=noninteractive<wait>",
        " debian-installer=en_US.UTF-8<wait>",
        " fb=false<wait>",
        " initrd=/install/initrd.gz<wait>",
        " kbd-chooser/method=us<wait>",
        " keyboard-configuration/layout=USA<wait>",
        " keyboard-configuration/variant=USA<wait>",
        " locale=en_US.UTF-8<wait>",
        " netcfg/get_domain=vm<wait>",
        " netcfg/get_hostname=vagrant<wait>",
        " grub-installer/bootdev=/dev/sda<wait>",
        " noapic<wait>",
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}<wait>",
        " -- <wait>",
        "<enter><wait>"
      ],
      "boot_wait": "10s",
      "disk_size": "{{user `disk_size`}}",
      "guest_os_type": "ubuntu-64",
      "headless": "{{ user `headless` }}",
      "http_directory": "{{user `http_directory`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
      "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-vmware",
      "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_username": "vagrant",
      "ssh_timeout": "10000s",
      "tools_upload_flavor": "linux",
      "type": "vmware-iso",
      "vm_name": "{{ user `template` }}",
      "memory": "{{ user `memory` }}",
      "cpus": "{{ user `cpus` }}",
      "vmx_data": {
        "cpuid.coresPerSocket": "1",
        "ethernet0.pciSlotNumber": "32"
      },
      "vmx_remove_ethernet_interfaces": true
    },
    {
      "boot_command": [
        "<esc><wait>",
        "<esc><wait>",
        "<enter><wait>",
        "/install/vmlinuz<wait>",
        " auto<wait>",
        " console-setup/ask_detect=false<wait>",
        " console-setup/layoutcode=us<wait>",
        " console-setup/modelcode=pc105<wait>",
        " debconf/frontend=noninteractive<wait>",
        " debian-installer=en_US.UTF-8<wait>",
        " fb=false<wait>",
        " initrd=/install/initrd.gz<wait>",
        " kbd-chooser/method=us<wait>",
        " keyboard-configuration/layout=USA<wait>",
        " keyboard-configuration/variant=USA<wait>",
        " locale=en_US.UTF-8<wait>",
        " netcfg/get_domain=vm<wait>",
        " netcfg/get_hostname=vagrant<wait>",
        " grub-installer/bootdev=/dev/sda<wait>",
        " noapic<wait>",
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}<wait>",
        " -- <wait>",
        "<enter><wait>"
      ],
      "boot_wait": "10s",
      "disk_size": "{{user `disk_size`}}",
      "guest_os_type": "ubuntu",
      "http_directory": "{{user `http_directory`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
      "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-parallels",
      "parallels_tools_flavor": "lin",
      "memory": "{{ user `memory` }}",
      "cpus": "{{ user `cpus` }}",
      "prlctl_version_file": ".prlctl_version",
      "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_username": "vagrant",
      "ssh_timeout": "10000s",
      "type": "parallels-iso",
      "vm_name": "{{ user `template` }}"
    },
    {
      "boot_command": [
        "<esc><wait>",
        "<esc><wait>",
        "<enter><wait>",
        "/install/vmlinuz<wait>",
        " auto<wait>",
        " console-setup/ask_detect=false<wait>",
        " console-setup/layoutcode=us<wait>",
        " console-setup/modelcode=pc105<wait>",
        " debconf/frontend=noninteractive<wait>",
        " debian-installer=en_US.UTF-8<wait>",
        " fb=false<wait>",
        " initrd=/install/initrd.gz<wait>",
        " kbd-chooser/method=us<wait>",
        " keyboard-configuration/layout=USA<wait>",
        " keyboard-configuration/variant=USA<wait>",
        " locale=en_US.UTF-8<wait>",
        " netcfg/get_domain=vm<wait>",
        " netcfg/get_hostname=vagrant<wait>",
        " grub-installer/bootdev=/dev/vda<wait>",
        " noapic<wait>",
        " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/{{user `preseed_path`}}<wait>",
        " -- <wait>",
        "<enter><wait>"
      ],
      "boot_wait": "10s",
      "disk_size": "{{user `disk_size`}}",
      "headless": "{{ user `headless` }}",
      "http_directory": "{{user `http_directory`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
      "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-qemu",
      "memory": "{{ user `memory` }}",
      "cpus": "{{ user `cpus` }}",
      "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_username": "vagrant",
      "ssh_timeout": "10000s",
      "type": "qemu",
      "vm_name": "{{ user `template` }}"
    },
    {
      "type": "openstack",
      "source_image_name": "{{ user `openstack_image` }}",
      "ssh_username": "ubuntu",
      "ssh_port": 22,
      "ssh_timeout": "10000s",
      "flavor": "{{ user `openstack_flavor` }}",
      "image_name": "{{ user `template` }}",
      "networks": [ "{{ user `openstack_internal_net` }}" ],
      "floating_ip_network": "{{ user `openstack_floating_net` }}",
      "image_disk_format": "qcow2",
      "use_blockstorage_volume": true,
      "volume_size": "80"
    },
    {
      "boot_command": [
        "<esc><wait10><esc><esc><enter><wait>",
        "set gfxpayload=1024x768<enter>",
        "linux /install/vmlinuz ",
        "preseed/url=http://{{.HTTPIP}}:{{.HTTPPort}}/preseed-hyperv.cfg ",
        "debian-installer=en_US.UTF-8 auto locale=en_US.UTF-8 kbd-chooser/method=us ",
        "hostname={{.Name}} ",
        "fb=false debconf/frontend=noninteractive ",
        "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
        "keyboard-configuration/variant=USA console-setup/ask_detect=false <enter>",
        "initrd /install/initrd.gz<enter>",
        "boot<enter>"
      ],
      "boot_wait": "10s",
      "communicator": "ssh",
      "cpus": "{{ user `cpus` }}",
      "disk_size": "{{user `disk_size`}}",
      "enable_secure_boot": false,
      "generation": "{{user `hyperv_generation`}}",
      "http_directory": "{{user `http_directory`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `mirror`}}/{{user `mirror_directory`}}/{{user `iso_name`}}",
      "memory": "{{user `memory`}}",
      "output_directory": "{{ user `build_directory` }}/packer-{{user `template`}}-hyperv",
      "shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now",
      "ssh_password": "vagrant",
      "ssh_port": 22,
      "ssh_timeout": "10000s",
      "ssh_username": "vagrant",
      "switch_name": "{{user `hyperv_switch`}}",
      "type": "hyperv-iso",
      "vm_name": "{{ user `template` }}"
    }
  ],
  "post-processors": [
    {
      "output": "{{ user `build_directory` }}/{{user `box_basename`}}.{{.Provider}}.box",
      "type": "vagrant"
    }
  ],
  "provisioners": [
    {
      "environment_vars": [
        "HOME_DIR=/home/vagrant",
        "http_proxy={{user `http_proxy`}}",
        "https_proxy={{user `https_proxy`}}",
        "no_proxy={{user `no_proxy`}}"
      ],
      "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'",
      "expect_disconnect": true,
      "scripts": [
        "{{template_dir}}/../_common/check_vagrant_user.sh",
        "{{template_dir}}/scripts/update.sh",
        "{{template_dir}}/../_common/motd.sh",
        "{{template_dir}}/../_common/sshd.sh",
        "{{template_dir}}/scripts/networking.sh",
        "{{template_dir}}/scripts/sudoers.sh",
        "{{template_dir}}/scripts/vagrant.sh",
        "{{template_dir}}/../_common/virtualbox.sh",
        "{{template_dir}}/scripts/vmware.sh",
        "{{template_dir}}/../_common/parallels.sh",
        "{{template_dir}}/scripts/hyperv.sh"
      ],
      "type": "shell"
    },
    {
      "environment_vars": [
        "HOME_DIR=/home/vagrant",
        "http_proxy={{user `http_proxy`}}",
        "https_proxy={{user `https_proxy`}}",
        "no_proxy={{user `no_proxy`}}",
        "STATE_FOLDER={{user `state_folder`}}"
      ],
      "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S su - vagrant -c '{{.Vars}} {{.Path}}'",
      "expect_disconnect": "true",
      "scripts": [
        "{{template_dir}}/scripts/install_osm.sh"
      ],
      "type": "shell"
    },
    {
      "type": "file",
      "source": "{{template_dir}}/scripts/update_osm_info_docker.sh",
      "destination": "/tmp/update_osm_info_docker.sh"
    },
    {
      "environment_vars": [
        "HOME_DIR=/home/vagrant",
        "http_proxy={{user `http_proxy`}}",
        "https_proxy={{user `https_proxy`}}",
        "no_proxy={{user `no_proxy`}}",
        "STATE_FOLDER={{user `state_folder`}}"
      ],
      "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S su - vagrant -c '{{.Vars}} {{.Path}}'",
      "expect_disconnect": "true",
      "inline": [
        "sudo mv /tmp/update_osm_info_docker.sh ${STATE_FOLDER}/",
        "sudo chmod a+rx ${STATE_FOLDER}/update_osm_info_docker.sh"
      ],
      "type": "shell"
    },
    {
      "environment_vars": [
        "HOME_DIR=/home/vagrant",
        "http_proxy={{user `http_proxy`}}",
        "https_proxy={{user `https_proxy`}}",
        "no_proxy={{user `no_proxy`}}"
      ],
      "execute_command": "echo 'vagrant' | {{.Vars}} sudo -S -E sh -eux '{{.Path}}'",
      "expect_disconnect": true,
      "scripts": [
        "{{template_dir}}/scripts/cleanup.sh",
        "{{template_dir}}/../_common/minimize.sh"
      ],
      "type": "shell"
    }
  ],
  "variables": {
    "box_basename": "osm-7.0.1",
    "build_directory": "../../builds",
    "http_directory": "{{template_dir}}/http",
    "build_timestamp": "{{isotime \"20060102150405\"}}",
    "cpus": "1",
    "disk_size": "65536",
    "git_revision": "__unknown_git_revision__",
    "headless": "",
    "http_proxy": "{{env `http_proxy`}}",
    "https_proxy": "{{env `https_proxy`}}",
    "hyperv_generation": "2",
    "openstack_internal_net": "{{env `NETWORK_ID`}}",
    "openstack_floating_net": "{{env `VIM_EXT_NET`}}",
    "openstack_flavor": "{{env `FLAVOR_NAME`}}",
    "openstack_image": "{{env `SOURCE_IMAGE_NAME`}}",
    "guest_additions_url": "",
    "iso_checksum": "e2ecdace33c939527cbc9e8d23576381c493b071107207d2040af72595f8990b",
    "iso_checksum_type": "sha256",
    "iso_name": "ubuntu-18.04.4-server-amd64.iso",
    "memory": "6144",
    "mirror": "http://cdimage.ubuntu.com",
    "mirror_directory": "ubuntu/releases/18.04.4/release",
    "name": "osm-7.0.1",
    "no_proxy": "{{env `no_proxy`}}",
    "preseed_path": "preseed.cfg",
    "template": "osm-7.0.1-amd64",
    "state_folder": "/etc/osm",
    "version": "TIMESTAMP"
  }
}
