Allow buiding all the things

This commit is contained in:
Greg Hellings
2023-08-12 13:54:23 -05:00
parent 4955599f41
commit 9577e133eb
6 changed files with 17 additions and 8 deletions
+1
View File
@@ -1,4 +1,5 @@
output_* output_*
output/*
*.box *.box
*.iso *.iso
.vagrant .vagrant
+1
View File
@@ -31,6 +31,7 @@
become: true become: true
ansible.builtin.reboot: ansible.builtin.reboot:
when: (_update_atomic is changed) or (_update_all is changed) when: (_update_atomic is changed) or (_update_all is changed)
failed_when: false # This module is buggy and can't always understand a reboot
- name: Wait for reboot to finish - name: Wait for reboot to finish
ansible.builtin.wait_for_connection: ansible.builtin.wait_for_connection:
+1 -1
View File
@@ -43,7 +43,7 @@ build {
post-processor "vagrant" { post-processor "vagrant" {
keep_input_artifact = true keep_input_artifact = true
compression_level = 9 compression_level = 9
output = "${local.name}.box" output = "output/{{ .Provider }}/${local.name}.box"
vagrantfile_template = "vagrant/${var.arch}.rb" vagrantfile_template = "vagrant/${var.arch}.rb"
} }
+2 -2
View File
@@ -27,8 +27,8 @@ source "qemu" "x86_64" {
cpu_model = "host" cpu_model = "host"
qemuargs = [ qemuargs = [
["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"], #["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"],
["-serial", "chardev:char0"] #["-serial", "chardev:char0"]
] ]
accelerator = var.qemu_accelerator accelerator = var.qemu_accelerator
+2 -2
View File
@@ -1,7 +1,7 @@
source "virtualbox-iso" "x86_64" { source "virtualbox-iso" "x86_64" {
iso_url = var.iso.url iso_url = var.iso.url
iso_checksum = var.iso.checksum iso_checksum = var.iso.checksum
output_directory = "output_virtualbox_${local.name}" output_directory = "output/virtualbox/${local.name}"
boot_command = var.boot_command boot_command = var.boot_command
shutdown_command = var.shutdown_command shutdown_command = var.shutdown_command
@@ -23,7 +23,7 @@ source "virtualbox-iso" "x86_64" {
guest_additions_sha256 = "bbabd89b8fff38a257bab039a278f0c4dc4426eff6e4238c1db01edb7284186a" guest_additions_sha256 = "bbabd89b8fff38a257bab039a278f0c4dc4426eff6e4238c1db01edb7284186a"
vboxmanage = [ vboxmanage = [
["modifyvm", "{{ .Name }}", "--uart1", "0x3F8", "4"], ["modifyvm", "{{ .Name }}", "--uart1", "0x3F8", "4"],
["modifyvm", "{{ .Name }}", "--uartmode1", "file", "serial-output-virtualbox-${var.arch}-${var.distro}-${var.version}"], #["modifyvm", "{{ .Name }}", "--uartmode1", "file", "output/vritualbox/serial-${var.arch}-${var.distro}-${var.version}"],
["modifyvm", "{{ .Name }}", "--nat-localhostreachable1", "on"], ["modifyvm", "{{ .Name }}", "--nat-localhostreachable1", "on"],
] ]
+10 -3
View File
@@ -51,9 +51,16 @@ def get_parser(args, unsupported=set()):
def main(): def main():
# Equivalent of `set -e` in Bash # Equivalent of `set -e` in Bash
#$RAISE_SUBPROC_ERROR = True #$RAISE_SUBPROC_ERROR = True
for box in g`*.box`: for box in g`output/**/*.box`:
sed -e f's#@@BOX@@#file:///home/greg/src/vms/vms/{box}#' -e f's/@@BOX_NAME@@/{box}/' Vagrantfile.in > Vagrantfile p = pathlib.Path(box)
vagrant up --provider virtualbox sed -e f's#@@BOX@@#file:///home/greg/src/vms/vms/{box}#' -e f's/@@BOX_NAME@@/{p.name}/' Vagrantfile.in > Vagrantfile
if str(p.parent.name) == "virtualbox":
vagrant up --provider virtualbox
elif str(p.parent.name) == "qemu":
vagrant up --provider libvirt
else:
print(f"Now whatcha wanna go and do that for? {box}")
continue
vagrant destroy -f vagrant destroy -f
rm -rf .vagrant rm -rf .vagrant