-
Notifications
You must be signed in to change notification settings - Fork 9
/
windows.pkr.hcl
66 lines (60 loc) · 1.5 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
variable "omi_name" {
type = string
default = "${env("OMI_NAME")}"
}
variable "base_name" {
type = string
default = "${env("BASE_NAME")}"
}
variable "volsize" {
type = string
default = "50"
}
variable "product_codes" {
type = list(string)
default = []
}
source "outscale-bsu" "windows" {
communicator = "winrm"
disable_stop_vm = true
omi_name = "${var.omi_name}"
force_delete_snapshot = true
bsu_optimized = true
launch_block_device_mappings {
delete_on_vm_deletion = true
device_name = "/dev/sda1"
volume_size = "${var.volsize}"
volume_type = "gp2"
}
source_omi_filter {
filters = {
image-name = "${var.base_name}-GOLDEN"
}
owners = [ "Outscale" ]
}
ssh_interface = "public_ip"
user_data_file = "scripts/windows/userdata"
vm_type = "tinav5.c4r8p1"
winrm_insecure = true
winrm_use_ssl = true
winrm_username = "Administrator"
product_codes = "${var.product_codes}"
}
build {
sources = [ "source.outscale-bsu.windows" ]
provisioner "windows-update" {}
provisioner "powershell" {
scripts = [
"scripts/windows/virtio.ps1",
"scripts/windows/enable-rtc.ps1",
"scripts/windows/cleanup.ps1"
]
}
provisioner "file" {
destination = "C:\\Windows\\Outscale\\"
source = "files/windows/"
}
provisioner "powershell" {
scripts = [ "scripts/windows/sysprep.ps1" ]
}
}