{
  "variables": {
    "user": "slapos",
    "password": "slapos",
    "disk_size": "100000"
  },

  "builders":
  [
    {
      "name": "ubuntu-15-04-server-testing-version",

      "type": "qemu",
      "format": "qcow2",
      "accelerator": "kvm",
      "disk_size": "{{ user `disk_size`}}",

      "headless": true,
      "iso_url": "http://releases.ubuntu.com/15.04/ubuntu-15.04-server-amd64.iso",
      "iso_checksum": "487f4a81f22f8597503db3d51a1b502e",
      "iso_checksum_type": "md5",

      "http_directory": "http",

      "ssh_username": "{{user `user`}}",
      "ssh_password": "{{user `password`}}",
      "ssh_wait_timeout": "1800s",
      "shutdown_command": "echo '{{user `password`}}'|sudo -S shutdown -P now",

      "boot_wait": "2s",
      "boot_command": [
        "<esc><esc><enter><wait>",
        "/install/vmlinuz url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed-ubuntu.cfg ",
        "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
        "hostname={{ .Name }} ",

        "keyboard-configuration/modelcode=SKIP ",
        "keyboard-configuration/layout=USA ",
        "keyboard-configuration/variant=USA ",

        "passwd/user-fullname={{user `user`}} ",
        "passwd/user-password-again={{user `password`}} ",
        "passwd/user-password={{user `password`}} ",
        "passwd/username={{user `user`}} ",

        "initrd=/install/initrd.gz -- <enter>"
            ]
    }
  ],

  "provisioners": [
    {
      "type": "shell",
      "execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
      "scripts": [
        "scripts/update-ubuntu.sh",
        "scripts/packages-ubuntu.sh",
        "scripts/setup-testing-version.sh",
        "scripts/network-ubuntu.sh"
      ]
    }
  ]
}
