-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.pkr.hcl
71 lines (65 loc) · 1.7 KB
/
build.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
packer {
required_plugins {
amazon = {
source = "github.com/hashicorp/amazon"
version = "~> 1"
}
ansible = {
source = "github.com/hashicorp/ansible"
version = "~> 1"
}
}
}
variable "region" {
type = string
default = "ap-southeast-1"
}
source "amazon-ebs" "windows-2022" {
ami_name = "${local.group}-${local.division}-${local.platform}-Windows-2022-Full-Base-${local.timestamp}"
communicator = "winrm"
instance_type = "t2.micro"
region = var.region
source_ami_filter {
filters = {
name = "Windows_Server-2022-English-Full-Base-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["amazon"]
}
user_data_file = "./winrm_bootstrap.txt"
force_deregister = true
winrm_insecure = true
winrm_username = "Administrator"
winrm_use_ssl = true
}
// source "amazon-ebs" "rhel-9" {
// ami_name = ""
// communicator = "ssh"
// instance_type = "ssh"
// region = var.region
// source_ami_filter {
// filters = {
// name = ""
// root-device-type = "ebs"
// virtualization-type = "hvm"
// }
// most_recent = true
// owners = ["amazon"]
// }
// user_data_file = ""
// force_deregister = true
// }
build {
// name = "temp-build-windows-2022"
sources = ["source.amazon-ebs.windows-2022"]
// provisioner "ansible" {
// playbook_file = "./cis-security/roles/cis_security/tasks/main.yml"
// extra_arguments = [
// "--extra-vars",
// "ansible_distribution=${var.ansible_distribution}",
// "ansible_distribution_major_version=${var.ansible_distribution_major_version}"
// ]
// }
}