test: improve vm image generation
This commit is contained in:
parent
b4311dac65
commit
3393d8f649
9 changed files with 47 additions and 8 deletions
|
|
@ -3,7 +3,6 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
build {
|
||||
name = "main"
|
||||
sources = [
|
||||
"source.qemu.archlinux-gnome",
|
||||
"source.qemu.archlinux-kde",
|
||||
|
|
@ -12,6 +11,7 @@ build {
|
|||
"source.qemu.ubuntu-server",
|
||||
]
|
||||
|
||||
# Upload local files
|
||||
provisioner "file" {
|
||||
destination = "/tmp"
|
||||
sources = ["${path.cwd}/packer/src"]
|
||||
|
|
@ -29,6 +29,7 @@ build {
|
|||
sources = ["${path.cwd}/../apparmor.d_${var.version}_all.deb"]
|
||||
}
|
||||
|
||||
# Wait for cloud-init to finish
|
||||
provisioner "shell" {
|
||||
execute_command = "echo '${var.password}' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
|
||||
inline = [
|
||||
|
|
@ -37,11 +38,13 @@ build {
|
|||
]
|
||||
}
|
||||
|
||||
# Install local files and config
|
||||
provisioner "shell" {
|
||||
script = "${path.cwd}/packer/init/init.sh"
|
||||
execute_command = "echo '${var.password}' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
|
||||
}
|
||||
|
||||
# Minimize the image
|
||||
provisioner "shell" {
|
||||
script = "${path.cwd}/packer/init/clean.sh"
|
||||
execute_command = "echo '${var.password}' | sudo -S sh -c '{{ .Vars }} {{ .Path }}'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue