-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindows10-enterprise.pkr.hcl
91 lines (79 loc) · 2.43 KB
/
windows10-enterprise.pkr.hcl
1
2
3
4
5
6
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
variable "iso_checksum" {
type = string
default = "SHA256:4767510FFB63CC6FE81BC81DDD377454751313185FFAE30B88DD597C8A24D371"
}
variable "iso_dir" {
type = string
default = "./iso"
}
variable "iso_name" {
type = string
default = "SW_DVD9_Win_Pro_10_20H2_64BIT_English_Pro_Ent_EDU_N_MLF_-2_X22-41520.iso"
}
variable "output_dir" {
type = string
default = "./output"
}
locals {
timestamp = formatdate("YYYYMMDDhhmm", timestamp())
}
source "hyperv-iso" "windows-10-bios" {
boot_wait = "4m"
cpus = 4
disk_size = 102400
headless = "true"
iso_checksum = "${var.iso_checksum}"
iso_url = "${var.iso_dir}/${var.iso_name}"
memory = 4096
output_directory = "${var.output_dir}-${local.timestamp}_w10e"
shutdown_command = "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\""
ssh_password = "vagrant"
ssh_username = "Admin"
ssh_wait_timeout = "2h"
switch_name = "Default Switch"
vm_name = "Windows_10_Enterprise"
floppy_files = [
"./answer_files/10/enterprise/bios/Autounattend.xml",
"./scripts/windows/fixnetwork.ps1",
"./scripts/windows/uac-disable.ps1",
"./scripts/windows/chocolatey.ps1",
"./scripts/windows/openssh-install.ps1"
]
}
source "hyperv-iso" "windows-10-uefi" {
boot_wait = "4m"
cpus = 4
disk_size = 102400
headless = "true"
iso_checksum = "${var.iso_checksum}"
iso_url = "${var.iso_dir}/${var.iso_name}"
memory = 4096
output_directory = "${var.output_dir}-${local.timestamp}_w10e_uefi"
shutdown_command = "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\""
ssh_password = "vagrant"
ssh_username = "Admin"
ssh_wait_timeout = "2h"
switch_name = "Default Switch"
vm_name = "Windows_10_Enterprise_with_UEFI"
generation = 2
enable_secure_boot = true
cd_files = [
"./answer_files/10/enterprise/uefi/Autounattend.xml",
"./scripts/windows/fixnetwork.ps1",
"./scripts/windows/uac-disable.ps1",
"./scripts/windows/chocolatey.ps1",
"./scripts/windows/openssh-install.ps1"
]
}
build {
description = "Windows 10 Enterprise"
sources = [
"source.hyperv-iso.windows-10-uefi"
]
provisioner "powershell" {
scripts = [
"./scripts/windows/openssh-nopassword.ps1",
"./scripts/windows/virtio.ps1",
]
}
}