-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwindows.pkr.hcl
131 lines (109 loc) · 2.88 KB
/
windows.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
92
93
94
95
96
97
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
packer {
}
variable "build_dir" {
type = string
default = env("PACKER_BUILD_DIR")
}
variable "template" {
type = string
}
variable "version" {
type = string
}
variable "guest_os_type" {
type = string
}
variable "iso_url" {
type = string
}
variable "iso_checksum" {
type = string
}
variable "record" {
type = string
default = "off"
}
locals {
cpus = 2
memory_mb = 4096
disk_size = 8000
communicator = {
communicator = "winrm"
winrm_timeout = "10h"
winrm_username = "vagrant"
winrm_password = "vagrant"
}
cd_files = [
"../../templates/${var.template}/Autounattend.xml",
"../../scripts/config/fixnetwork.ps1",
"../../scripts/config/disable-screensaver.ps1",
"../../scripts/config/disable-winrm.ps1",
"../../scripts/config/enable-winrm.ps1",
"../../scripts/config/win-updates.ps1",
"../../scripts/config/enable-rdp.ps1",
"../../scripts/config/virtualbox-tools.ps1",
"../../scripts/eDNI/firefox.ps1",
"../../scripts/eDNI/chrome.ps1",
"../../scripts/eDNI/AutoFirma.ps1",
"../../scripts/eDNI/DNIeRemote.ps1",
"../../scripts/eDNI/Tarjetas_DNIe.ps1",
]
shutdown = {
command = "shutdown /s /t 5 /f /d p:4:1 /c \"Packer Shutdown\""
timeout = "30m"
}
}
source "virtualbox-iso" "edni_windows" {
vm_name = var.template
format = "ova"
guest_os_type = var.guest_os_type
headless = true
firmware = "efi"
guest_additions_mode = "disable"
vboxmanage = [
[
"modifyvm", "{{ .Name }}",
"--memory", local.memory_mb,
"--cpus", local.cpus,
"--firmware", "efi",
],
[
"modifyvm", "{{ .Name }}",
"--recordingscreens", "0",
"--recordingvideores", "1024x768",
"--recordingvideorate", "512",
"--recordingvideofps", "25",
"--recordingfile", "${var.build_dir}/capture.webm",
"--recordingopts", "vc_enabled=true,ac_enabled=true,ac_profile=med",
"--recording", "${var.record}",
],
]
vboxmanage_post = [
[
"modifyvm", "{{ .Name }}",
"--recording", "off",
],
]
hard_drive_interface = "sata"
iso_interface = "sata"
iso_url = var.iso_url
iso_checksum = "md5:${var.iso_checksum}"
boot_command = ["a<wait>a<wait>a"]
boot_wait = "-1s"
communicator = local.communicator.communicator
winrm_timeout = local.communicator.winrm_timeout
winrm_username = local.communicator.winrm_username
winrm_password = local.communicator.winrm_password
cd_files = local.cd_files
shutdown_command = local.shutdown.command
shutdown_timeout = local.shutdown.timeout
}
build {
sources = [
"source.virtualbox-iso.edni_windows",
]
post-processor "vagrant" {
output = "eDNI-${var.template}_${var.version}.box"
vagrantfile_template = "../../templates/${var.template}/vagrantfile.template"
}
}