-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.pkr.hcl
33 lines (29 loc) · 1.03 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
build {
sources = [
# Cobalt Strike does not currently support ARM64.
# "source.amazon-ebs.arm64",
"source.amazon-ebs.x86_64",
]
provisioner "ansible" {
playbook_file = "ansible/upgrade.yml"
use_proxy = false
use_sftp = true
}
provisioner "ansible" {
playbook_file = "ansible/python.yml"
use_proxy = false
use_sftp = true
}
provisioner "ansible" {
ansible_env_vars = ["AWS_DEFAULT_REGION=${var.build_region}"]
extra_arguments = ["--extra-vars", "{build_bucket: ${var.build_bucket}}"]
playbook_file = "ansible/playbook.yml"
use_proxy = false
use_sftp = true
}
provisioner "shell" {
execute_command = "chmod +x {{ .Path }}; sudo env {{ .Vars }} {{ .Path }} ; rm -f {{ .Path }}"
inline = ["sed -i '/^users:/ {N; s/users:.*/users: []/g}' /etc/cloud/cloud.cfg", "rm --force /etc/sudoers.d/90-cloud-init-users", "rm --force /root/.ssh/authorized_keys", "/usr/sbin/userdel --remove --force admin"]
skip_clean = true
}
}