-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaws-debian.pkr.hcl
72 lines (62 loc) · 1.28 KB
/
aws-debian.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
variable "region" {
type=string
default="eu-west-1"
sensitive=false
}
packer {
required_plugins {
amazon = {
version = ">= 0.0.2"
source = "github.com/hashicorp/amazon"
}
}
}
source "amazon-ebs" "debian" {
ami_name = "openline-voice-homer"
instance_type = "t2.micro"
region = "${var.region}"
source_ami_filter {
filters = {
name = "debian-12-amd64-*"
root-device-type = "ebs"
virtualization-type = "hvm"
}
most_recent = true
owners = ["136693071363"]
}
ssh_username = "admin"
}
build {
name = "openline-voice-homer-server"
sources = [
"source.amazon-ebs.debian"
]
provisioner "file" {
source = "setup.sh"
destination = "/tmp/"
}
provisioner "file" {
source = "genconf.sh"
destination = "/tmp/"
}
provisioner "file" {
source = "grafana"
destination = "/tmp/"
}
provisioner "file" {
source = "vector"
destination = "/tmp/"
}
provisioner "file" {
source = "qryn.service"
destination = "/tmp/"
}
provisioner "shell" {
inline= [
"sudo sh -c 'chmod a+x /tmp/setup.sh'",
"sudo sh -c '/tmp/setup.sh'",
"sudo sh -c 'mv /tmp/genconf.sh /usr/sbin/'",
"sudo sh -c 'chmod a+x /usr/sbin/genconf.sh'"
]
}
}