-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathtemplate.pkr.hcl
More file actions
91 lines (77 loc) · 1.88 KB
/
template.pkr.hcl
File metadata and controls
91 lines (77 loc) · 1.88 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
source "amazon-ebssurrogate" "source" {
source_ami_filter {
filters = {
virtualization-type = "hvm"
name = "ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"
root-device-type = "ebs"
}
owners = [
"099720109477" // Canonical
]
most_recent = true
}
instance_type = "m4.large"
region = "us-west-2"
ena_support = true
launch_block_device_mappings {
device_name = "/dev/xvdf"
delete_on_termination = true
volume_size = 8
volume_type = "gp2"
}
run_tags = {
Name = "Packer Builder - ZFS Root Ubuntu"
}
run_volume_tags = {
Name = "Packer Builder - ZFS Root Ubuntu"
}
communicator = "ssh"
ssh_pty = true
ssh_username = "ubuntu"
ssh_timeout = "5m"
ami_name = "ubuntu-focal-20.04-amd64-zfs-server-${formatdate("YYYY-MM-DD-hhmm", timestamp())}"
ami_description = "Ubuntu Focal (20.04) with ZFS Root Filesystem"
ami_virtualization_type = "hvm"
ami_regions = []
ami_root_device {
source_device_name = "/dev/xvdf"
device_name = "/dev/xvda"
delete_on_termination = true
volume_size = 8
volume_type = "gp2"
}
tags = {
Name = "Ubuntu Focal (20.04) with ZFS Root Filesystem"
}
}
build {
sources = [
"source.amazon-ebssurrogate.source"
]
provisioner "file" {
source = "files/sources-us-west-2.list"
destination = "/tmp/sources.list"
}
provisioner "file" {
source = "files/ebsnvme-id"
destination = "/tmp/ebsnvme-id"
}
provisioner "file" {
source = "files/70-ec2-nvme-devices.rules"
destination = "/tmp/70-ec2-nvme-devices.rules"
}
provisioner "file" {
source = "files/zfs-growpart-root.cfg"
destination = "/tmp/zfs-growpart-root.cfg"
}
provisioner "file" {
source = "scripts/chroot-bootstrap.sh"
destination = "/tmp/chroot-bootstrap.sh"
}
provisioner "shell" {
script = "scripts/surrogate-bootstrap.sh"
execute_command = "sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
start_retry_timeout = "5m"
skip_clean = true
}
}