windows_2016_core.json 4.39 KB
Newer Older
Stefan Scherer's avatar
Stefan Scherer committed
1 2
{
  "builders": [
3 4
    {
      "boot_wait": "0s",
5 6 7 8
      "communicator": "winrm",
      "cpu": 2,
      "disk_size": "{{user `disk_size`}}",
      "enable_secure_boot": true,
9 10
      "floppy_files": [
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
11
        "./scripts/disable-screensaver.ps1",
12 13 14 15 16
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
17 18 19 20
      "guest_additions_mode": "disable",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `iso_url`}}",
21
      "ram_size": 2048,
22 23 24 25 26 27 28
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "switch_name": "{{user `hyperv_switchname`}}",
      "type": "hyperv-iso",
      "vm_name": "WindowsServer2016Core",
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
29
    },
Stefan Scherer's avatar
Stefan Scherer committed
30 31
    {
      "boot_wait": "2m",
32
      "communicator": "winrm",
33 34
      "disk_size": "{{user `disk_size`}}",
      "disk_type_id": "{{user `disk_type_id`}}",
Stefan Scherer's avatar
Stefan Scherer committed
35 36
      "floppy_files": [
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
37
        "./scripts/disable-screensaver.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
38 39 40 41 42
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
        "./scripts/win-updates.ps1"
      ],
43 44 45 46 47 48 49
      "guest_os_type": "windows9srv-64",
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `iso_url`}}",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "vmware-iso",
Stefan Scherer's avatar
Stefan Scherer committed
50 51 52 53 54 55
      "vmx_data": {
        "RemoteDisplay.vnc.enabled": "false",
        "RemoteDisplay.vnc.port": "5900",
        "memsize": "2048",
        "numvcpus": "2",
        "scsi0.virtualDev": "lsisas1068"
56 57 58 59 60 61 62
      },
      "vmx_remove_ethernet_interfaces": true,
      "vnc_port_max": 5980,
      "vnc_port_min": 5900,
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
Stefan Scherer's avatar
Stefan Scherer committed
63 64 65
    },
    {
      "boot_wait": "2m",
66
      "communicator": "winrm",
67
      "disk_size": "{{user `disk_size`}}",
Stefan Scherer's avatar
Stefan Scherer committed
68 69
      "floppy_files": [
        "{{user `autounattend`}}",
Stefan Scherer's avatar
Stefan Scherer committed
70
        "./scripts/disable-screensaver.ps1",
Stefan Scherer's avatar
Stefan Scherer committed
71 72 73
        "./scripts/disable-winrm.ps1",
        "./scripts/enable-winrm.ps1",
        "./scripts/microsoft-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
74
        "./scripts/win-updates.ps1"
Stefan Scherer's avatar
Stefan Scherer committed
75
      ],
76
      "guest_additions_mode": "disable",
Stefan Scherer's avatar
Stefan Scherer committed
77
      "guest_os_type": "Windows2016_64",
78 79 80 81 82 83
      "headless": "{{user `headless`}}",
      "iso_checksum": "{{user `iso_checksum`}}",
      "iso_checksum_type": "{{user `iso_checksum_type`}}",
      "iso_url": "{{user `iso_url`}}",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
      "type": "virtualbox-iso",
Stefan Scherer's avatar
Stefan Scherer committed
84 85 86 87 88 89 90 91 92 93 94 95 96
      "vboxmanage": [
        [
          "modifyvm",
          "{{.Name}}",
          "--memory",
          "2048"
        ],
        [
          "modifyvm",
          "{{.Name}}",
          "--cpus",
          "2"
        ]
97 98 99 100 101 102 103 104 105 106 107 108
      ],
      "winrm_password": "vagrant",
      "winrm_timeout": "{{user `winrm_timeout`}}",
      "winrm_username": "vagrant"
    }
  ],
  "post-processors": [
    {
      "keep_input_artifact": false,
      "output": "windows_2016_core_{{.Provider}}.box",
      "type": "vagrant",
      "vagrantfile_template": "vagrantfile-windows_2016_core.template"
Stefan Scherer's avatar
Stefan Scherer committed
109 110 111 112 113 114
    }
  ],
  "provisioners": [
    {
      "scripts": [
        "./scripts/vm-guest-tools.bat",
115
        "./scripts/enable-rdp.bat"
116 117
      ],
      "type": "windows-shell"
Stefan Scherer's avatar
Stefan Scherer committed
118 119 120 121
    },
    {
      "scripts": [
        "./scripts/debloat-windows.ps1"
122 123
      ],
      "type": "powershell"
Stefan Scherer's avatar
Stefan Scherer committed
124 125 126
    },
    {
      "scripts": [
127
        "./scripts/set-winrm-automatic.bat",
Stefan Scherer's avatar
Stefan Scherer committed
128
        "./scripts/uac-enable.bat",
129 130
        "./scripts/compile-dotnet-assemblies.bat",
        "./scripts/dis-updates.bat",
Stefan Scherer's avatar
Stefan Scherer committed
131
        "./scripts/compact.bat"
132 133
      ],
      "type": "windows-shell"
Stefan Scherer's avatar
Stefan Scherer committed
134 135 136
    }
  ],
  "variables": {
137
    "autounattend": "./answer_files/2016_core/Autounattend.xml",
138 139
    "disk_size": "61440",
    "disk_type_id": "1",
140
    "headless": "false",
Patrick Lang's avatar
Patrick Lang committed
141
    "iso_checksum": "70721288BBCDFE3239D8F8C0FAE55F1F",
142
    "iso_checksum_type": "md5",
143
    "iso_url": "https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO",
144
    "winrm_timeout": "6h"
Stefan Scherer's avatar
Stefan Scherer committed
145 146
  }
}
147