-
Notifications
You must be signed in to change notification settings - Fork 2
/
packer.pkr.hcl
57 lines (45 loc) · 1.06 KB
/
packer.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
variable "created_email" {}
variable "created_name" {}
source "amazon-ebs" "hashistack" {
ami_name = "Hashistack {{timestamp}}"
region = "us-east-1"
instance_type = "t2.medium"
#source_ami = "ami-0a4f4704a9146742a"
source_ami_filter {
filters {
virtualization-type = "hvm"
name = "ubuntu/images/*ubuntu-bionic-18.04-amd64-server-*"
root-device-type = "ebs"
}
owners = ["099720109477"] # Canonical's owner ID
most_recent = true
}
communicator = "ssh"
ssh_username = "ubuntu"
ami_groups = ["all"]
tags {
OS_Version = "Ubuntu"
Release = "18.04"
Architecture = "amd64"
Created_Email = var.created_email
Created_Name = var.created_name
}
}
build {
sources = [
"source.amazon-ebs.hashistack"
]
provisioner "shell" {
inline = [
"sudo mkdir /ops",
"sudo chmod 777 /ops"
]
}
provisioner "file" {
source = "../shared"
destination = "/ops"
}
provisioner "shell" {
script = "../shared/scripts/setup.sh"
}
}