Skip to content

Commit 4b54c62

Browse files
authored
Ugly workaround for openSUSE/MirrorCache#528 (#138)
1 parent 73afe53 commit 4b54c62

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ context-linux/*.rpm
1515
context-linux/*.deb
1616
context-linux/.vagrant*/
1717
context-linux/*~bak
18+
.vscode

packer/opensuse/opensuse.pkr.hcl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ build {
99
"cloud-localds ${var.input_dir}/${var.appliance_name}-cloud-init.iso ${var.input_dir}/cloud-init.yml",
1010
]
1111
}
12+
13+
# Workaround for https://github.com/openSUSE/MirrorCache/issues/528
14+
provisioner "shell-local" {
15+
inline = [
16+
# Replace image name for symlinked image on checksum file
17+
"wget -O ${var.checksum_file} ${var.checksum_url}",
18+
"sed -i 's/${var.iso_prefix}-.*\\.qcow2/${var.iso_prefix}-Cloud.qcow2/' ${var.checksum_file}",
19+
]
20+
}
1221
}
1322

1423
# Build VM image
@@ -18,7 +27,8 @@ source "qemu" "opensuse" {
1827
accelerator = "kvm"
1928

2029
iso_url = lookup(lookup(var.opensuse, var.version, {}), "iso_url", "")
21-
iso_checksum = lookup(lookup(var.opensuse, var.version, {}), "iso_checksum", "")
30+
# iso_checksum = lookup(lookup(var.opensuse, var.version, {}), "iso_checksum", "")
31+
iso_checksum = "file:${var.checksum_file}"
2232

2333
headless = var.headless
2434

packer/opensuse/variables.pkr.hcl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,20 @@ variable "opensuse" {
3131
}
3232
}
3333
}
34+
35+
# Workaround for https://github.com/openSUSE/MirrorCache/issues/528
36+
37+
variable "iso_prefix" {
38+
type = string
39+
default = "openSUSE-Leap-15.6-Minimal-VM.x86_64"
40+
}
41+
42+
variable "checksum_file" {
43+
type = string
44+
default = "/tmp/checksum.sha256"
45+
}
46+
47+
variable "checksum_url" {
48+
type = string
49+
default = "https://download.opensuse.org/distribution/leap/15.6/appliances/openSUSE-Leap-15.6-Minimal-VM.x86_64-Cloud.qcow2.sha256"
50+
}

0 commit comments

Comments
 (0)