Skip to content

Commit 50fa3c8

Browse files
committed
packer: Use HCL2
1 parent d688ce5 commit 50fa3c8

17 files changed

Lines changed: 205 additions & 144 deletions

packer/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ packer_cache
33
crash.log
44
*.box
55
templates/
6+
cloud-generic

packer/Makefile

Lines changed: 0 additions & 12 deletions
This file was deleted.

packer/fragments/base-qemu-glibc64.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

packer/fragments/base-vbox-glibc64.json

Lines changed: 0 additions & 31 deletions
This file was deleted.

packer/fragments/platform-digitalocean.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

packer/fragments/platform-vagrant.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

packer/fragments/provisioner-cloud.json

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
build {
2+
name = "cloud-generic-x86_64"
3+
4+
source "source.qemu.x86_64" {
5+
boot_command = [
6+
"<tab><wait>",
7+
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64.cfg",
8+
"<enter>"
9+
]
10+
vm_name = "voidlinux-x86_64"
11+
output_directory = "cloud-generic-x86_64"
12+
}
13+
14+
provisioner "shell" {
15+
script = "scripts/cloud.sh"
16+
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
17+
}
18+
}
19+
20+
build {
21+
name = "cloud-generic-x86_64-musl"
22+
23+
source "source.qemu.x86_64" {
24+
boot_command = [
25+
"<tab><wait>",
26+
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64-musl.cfg",
27+
"<enter>"
28+
]
29+
vm_name = "voidlinux-x86_64-musl"
30+
output_directory = "cloud-generic-x86_64-musl"
31+
}
32+
33+
provisioner "shell" {
34+
script = "scripts/cloud.sh"
35+
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
36+
}
37+
}

packer/hcl2/build-vagrant.pkr.hcl

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
build {
2+
name = "vagrant-virtualbox-x86_64"
3+
4+
source "source.virtualbox-iso.x86_64" {
5+
boot_command = [
6+
"<tab><wait>",
7+
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64.cfg",
8+
"<enter>"
9+
]
10+
vm_name = "voidlinux-x86_64"
11+
output_directory = "vagrant-virtualbox-x86_64"
12+
}
13+
14+
provisioner "shell" {
15+
script = "scripts/vagrant.sh"
16+
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
17+
}
18+
19+
post-processor "vagrant" {
20+
output = "vagrant-virtualbox-x86_64.box"
21+
}
22+
}
23+
24+
build {
25+
name = "vagrant-virtualbox-x86_64-musl"
26+
27+
source "source.virtualbox-iso.x86_64" {
28+
boot_command = [
29+
"<tab><wait>",
30+
"auto autourl=http://{{.HTTPIP}}:{{.HTTPPort}}/x86_64-musl.cfg",
31+
"<enter>"
32+
]
33+
vm_name = "voidlinux-x86_64-musl"
34+
output_directory = "vagrant-virtualbox-x86_64-musl"
35+
}
36+
37+
provisioner "shell" {
38+
script = "scripts/vagrant.sh"
39+
execute_command = "echo 'void' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
40+
}
41+
42+
post-processor "vagrant" {
43+
output = "vagrant-virtualbox-x86_64-musl.box"
44+
}
45+
}

packer/hcl2/source-qemu.pkr.hcl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
source "qemu" "x86_64" {
2+
accelerator = "kvm"
3+
boot_wait = "5s"
4+
disk_interface = "virtio"
5+
disk_size = "1000M"
6+
format = "qcow2"
7+
http_directory = "http"
8+
iso_checksum = "sha256:d95d40e1eb13a7776b5319a05660792fddd762662eaecee5df6b8feb3aa9b391"
9+
iso_url = "https://alpha.de.repo.voidlinux.org/live/20200722/void-live-x86_64-5.7.10_1-20200722.iso"
10+
ssh_password = "void"
11+
ssh_timeout = "20m"
12+
ssh_username = "void"
13+
}

0 commit comments

Comments
 (0)