-
Notifications
You must be signed in to change notification settings - Fork 9
/
windows-sql.pkr.hcl
75 lines (68 loc) · 1.74 KB
/
windows-sql.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
variable "omi_name" {
type = string
default = "${env("OMI_NAME")}"
}
variable "iso" {
type = string
default = "${env("ISO_URL")}"
}
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 = "WindowsServer-2019-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 "powershell" {
scripts = [
"scripts/windows/cleanup.ps1"
]
}
provisioner "file" {
destination = "C:\\Windows\\Outscale\\"
source = "files/windows/"
}
provisioner "powershell" {
environment_vars = ["ISO_URL=${var.iso}"]
scripts = [
"scripts/windows/mssql.ps1",
"scripts/windows/ssms.ps1",
"scripts/windows/firewall-tcp-1433.ps1",
"scripts/windows/virtio.ps1",
"scripts/windows/enable-rtc.ps1"
]
}
provisioner "windows-update" {}
provisioner "powershell" {
scripts = [ "scripts/windows/sysprep.ps1" ]
}
}