diff --git a/.gitignore b/.gitignore index 67fff14..a1b499b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ output_* +output/* *.box *.iso .vagrant diff --git a/ansible/playbook.yml b/ansible/playbook.yml index 6725b08..73e7cf4 100644 --- a/ansible/playbook.yml +++ b/ansible/playbook.yml @@ -31,6 +31,7 @@ become: true ansible.builtin.reboot: 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 ansible.builtin.wait_for_connection: diff --git a/sources/build.pkr.hcl b/sources/build.pkr.hcl index d03eb3f..d4f2f05 100644 --- a/sources/build.pkr.hcl +++ b/sources/build.pkr.hcl @@ -43,7 +43,7 @@ build { post-processor "vagrant" { keep_input_artifact = true compression_level = 9 - output = "${local.name}.box" + output = "output/{{ .Provider }}/${local.name}.box" vagrantfile_template = "vagrant/${var.arch}.rb" } diff --git a/sources/qemu.pkr.hcl b/sources/qemu.pkr.hcl index 058acc9..292f7c8 100644 --- a/sources/qemu.pkr.hcl +++ b/sources/qemu.pkr.hcl @@ -27,8 +27,8 @@ source "qemu" "x86_64" { cpu_model = "host" qemuargs = [ - ["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"], - ["-serial", "chardev:char0"] + #["-chardev", "stdio,id=char0,logfile=serial-output-qemu-${var.arch}-${var.distro}-${var.version},signal=off"], + #["-serial", "chardev:char0"] ] accelerator = var.qemu_accelerator diff --git a/sources/virtualbox-iso.pkr.hcl b/sources/virtualbox-iso.pkr.hcl index ff73535..81f49c5 100644 --- a/sources/virtualbox-iso.pkr.hcl +++ b/sources/virtualbox-iso.pkr.hcl @@ -1,7 +1,7 @@ source "virtualbox-iso" "x86_64" { iso_url = var.iso.url iso_checksum = var.iso.checksum - output_directory = "output_virtualbox_${local.name}" + output_directory = "output/virtualbox/${local.name}" boot_command = var.boot_command shutdown_command = var.shutdown_command @@ -23,7 +23,7 @@ source "virtualbox-iso" "x86_64" { guest_additions_sha256 = "bbabd89b8fff38a257bab039a278f0c4dc4426eff6e4238c1db01edb7284186a" vboxmanage = [ ["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"], ] diff --git a/test.xsh b/test.xsh index 6e73cbf..c470e4e 100755 --- a/test.xsh +++ b/test.xsh @@ -51,9 +51,16 @@ def get_parser(args, unsupported=set()): def main(): # Equivalent of `set -e` in Bash #$RAISE_SUBPROC_ERROR = True - for box in g`*.box`: - sed -e f's#@@BOX@@#file:///home/greg/src/vms/vms/{box}#' -e f's/@@BOX_NAME@@/{box}/' Vagrantfile.in > Vagrantfile - vagrant up --provider virtualbox + for box in g`output/**/*.box`: + p = pathlib.Path(box) + 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 rm -rf .vagrant