{
  "variables": {
    "user": "slapos",
    "password": "slapos",
    "disk_size": "200000",
    "domain": ""
  },

  "builders":
  [
    {
      "name": "centos7-vm-bootstrap",

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

      "iso_url": "http://mirrors.kernel.org/centos/7/isos/x86_64/CentOS-7-x86_64-NetInstall-1708.iso",
      "iso_checksum": "fe3d960cce4d2c1c9f1b66817fe87cc0ee1a1c6c5dd126204cb5c33d51a45620",
      "iso_checksum_type": "sha256",

      "http_directory": "http",

      "ssh_username": "{{user `user`}}",
      "ssh_password": "{{user `password`}}",
      "ssh_wait_timeout": "1800s",
      "shutdown_command": "sudo poweroff",

      "headless": true,
      "boot_wait": "2s",
      "boot_command": [
        "<esc>",
        "<wait>",
        "linux ks=http://{{.HTTPIP}}:{{.HTTPPort}}/centos72-anaconda-ks.cfg biosdevname=0 net.ifnames=0",
        "<enter>"
      ]
    }
  ],

  "provisioners": [
    {
      "type": "shell",
      "execute_command": "echo '{{user `password`}}' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
      "scripts": [
        "scripts/update-centos.sh",
        "scripts/packages-centos.sh",
        "scripts/cleanup-centos.sh",
        "scripts/centos7-install-base.sh",
        "scripts/vm-bootstrap.sh"
      ]
    }
  ]
}
