windows_server_1709.json 5.43 KB
Newer Older
Stefan Scherer's avatar
Stefan Scherer committed
1 2 3 4 5
{
  "builders": [
    {
      "vm_name":"WindowsServer1709",
      "type": "hyperv-iso",
6
      "disk_size": "{{user `disk_size`}}",
Stefan Scherer's avatar
Stefan Scherer committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
      "boot_wait": "60s",
      "guest_additions_mode":"disable",
      "iso_url": "{{user `iso_url`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
        "./scripts/docker/2016/install-containers-feature.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "communicator":"winrm",
      "winrm_username": "vagrant",
      "winrm_password": "vagrant",
      "winrm_timeout" : "2h",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "ram_size": 2048,
      "cpu": 2,
      "switch_name":"{{user `hyperv_switchname`}}",
      "enable_secure_boot":true,
      "enable_virtualization_extensions":true
    },
    {
      "vm_name":"WindowsServer1709",
      "type": "vmware-iso",
      "communicator": "winrm",
      "iso_url": "{{user `iso_url`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "headless": "{{user `headless`}}",
      "boot_wait": "60s",
      "winrm_username": "vagrant",
      "winrm_password": "vagrant",
      "winrm_timeout": "2h",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "guest_os_type": "windows9srv-64",
48 49
      "disk_size": "{{user `disk_size`}}",
      "version": 11,
Stefan Scherer's avatar
Stefan Scherer committed
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
      "vnc_port_min": 5900,
      "vnc_port_max": 5980,
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
        "./scripts/docker/2016/install-containers-feature.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
        "RemoteDisplay.vnc.port": "5900",
        "memsize": "2048",
        "numvcpus": "2",
        "scsi0.virtualDev": "lsisas1068",
69
        "vhv.enable": "{{user `vhv_enable`}}"
Stefan Scherer's avatar
Stefan Scherer committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
      }
    },
    {
      "vm_name":"WindowsServer1709",
      "type": "virtualbox-iso",
      "communicator": "winrm",
      "iso_url": "{{user `iso_url`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "headless": "{{user `headless`}}",
      "boot_wait": "60s",
      "winrm_username": "vagrant",
      "winrm_password": "vagrant",
      "winrm_timeout": "2h",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "guest_os_type": "Windows2012_64",
      "guest_additions_mode": "disable",
87
      "disk_size": "{{user `disk_size`}}",
Stefan Scherer's avatar
Stefan Scherer committed
88 89 90 91 92 93 94 95 96
      "floppy_files": [
        "{{user `autounattend`}}",
        "./floppy/WindowsPowershell.lnk",
        "./floppy/PinTo10.exe",
        "./scripts/disable-screensaver.ps1",
        "./scripts/disable-winrm.ps1",
        "./scripts/docker/enable-winrm.ps1",
        "./scripts/docker/2016/install-containers-feature.ps1",
        "./scripts/microsoft-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
97
        "./scripts/win-updates.ps1"
Stefan Scherer's avatar
Stefan Scherer committed
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
      ],
      "vboxmanage": [
        [
          "modifyvm",
          "{{.Name}}",
          "--memory",
          "2048"
        ],
        [
          "modifyvm",
          "{{.Name}}",
          "--cpus",
          "2"
        ]
      ]
    }
  ],
  "provisioners": [
    {
      "type": "windows-shell",
      "scripts": [
        "./scripts/vm-guest-tools.bat",
        "./scripts/enable-rdp.bat"
      ]
    },
    {
      "type": "powershell",
      "scripts": [
        "./scripts/docker/2016/install-containers-feature.ps1"
      ]
    },
    {
      "type": "windows-restart"
    },
    {
      "type": "powershell",
      "scripts": [
        "./scripts/docker/add-docker-group.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
136
        "./scripts/docker/set-winrm-automatic.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
137 138 139
        "./scripts/docker/2016/install-docker-ee-preview.ps1",
        "./scripts/docker/docker-pull-1709-async.ps1",
        "./scripts/docker/open-docker-insecure-port.ps1",
140
        "./scripts/docker/open-docker-swarm-ports.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165
        "./scripts/docker/remove-docker-key-json.ps1",
        "./scripts/docker/disable-windows-defender.ps1"
      ]
    },
    {
      "type": "windows-restart"
    },
    {
      "type": "windows-shell",
      "scripts": [
        "./scripts/compile-dotnet-assemblies.bat",
        "./scripts/compact.bat"
      ]
    }
  ],
  "post-processors": [
    {
      "type": "vagrant",
      "keep_input_artifact": false,
      "output": "windows_server_1709_{{.Provider}}.box",
      "vagrantfile_template": "vagrantfile-windows_2016.template"
    }
  ],
  "variables": {
    "headless": "false",
166 167 168
    "disk_size": "61440",
    "disk_type_id": "1",
    "vhv_enable": "false",
Stefan Scherer's avatar
Stefan Scherer committed
169 170 171 172
    "manually_download_iso_from": "https://my.visualstudio.com/downloads?pid=2347",
    "iso_url": "https://software-download.microsoft.com/pr/en_windows_server_version_1709_x64_dvd_100090904.iso",
    "iso_checksum_type": "sha256",
    "iso_checksum": "ca1108d5be2c091bfb57e8f3db3be1e8baa9c32802131f7a6e43e63f7b596591",
173
    "autounattend": "./answer_files/1709/Autounattend.xml"
Stefan Scherer's avatar
Stefan Scherer committed
174 175
  }
}