#!ipxe

set server_ip 10.10.50.10
set base_url http://${server_ip}

menu Provision Server

item --gap -- ---------------- Group A ----------------
item group_a_custom_iso Install Group A - Custom Ubuntu 24.04 Full Autoinstall ISO
item group_a_ubuntu2404 Install Group A - Ubuntu 24.04 standard autoinstall

item --gap -- ---------------- Group B ----------------
item group_b_ubuntu2404 Install Group B - Ubuntu 24.04 standard autoinstall

item --gap -- ---------------- Group C ----------------
item group_c_ubuntu2404 Install Group C - Ubuntu 24.04 standard autoinstall

item --gap -- ---------------- Group D ----------------
item group_d_ubuntu2404 Install Group D - Ubuntu 24.04 standard autoinstall

item --gap -- ---------------- Tools ----------------
item shell iPXE shell
item reboot Reboot

choose --default group_a_custom_iso --timeout 10000 target && goto ${target}

:group_a_custom_iso
echo Booting Group A Custom Ubuntu 24.04 ISO...
kernel ${base_url}/images/ubuntu-24.04/group-a/custom-os/vmlinuz ip=dhcp url=${base_url}/images/ubuntu-24.04/group-a/custom-os/ubuntu-24.04-full-autoinstall.iso
initrd ${base_url}/images/ubuntu-24.04/group-a/custom-os/initrd
boot

:group_a_ubuntu2404
echo Booting Group A Ubuntu 24.04 standard autoinstall...
kernel ${base_url}/images/ubuntu-24.04/vmlinuz ip=dhcp url=${base_url}/images/ubuntu-24.04/ubuntu-24.04-live-server-amd64.iso autoinstall ds=nocloud-net;s=${base_url}/autoinstall/ubuntu-24.04/type-a/
initrd ${base_url}/images/ubuntu-24.04/initrd
boot

:group_b_ubuntu2404
echo Booting Group B Ubuntu 24.04 standard autoinstall...
kernel ${base_url}/images/ubuntu-24.04/vmlinuz ip=dhcp url=${base_url}/images/ubuntu-24.04/ubuntu-24.04-live-server-amd64.iso autoinstall ds=nocloud-net;s=${base_url}/autoinstall/ubuntu-24.04/type-b/
initrd ${base_url}/images/ubuntu-24.04/initrd
boot

:group_c_ubuntu2404
echo Booting Group C Ubuntu 24.04 standard autoinstall...
kernel ${base_url}/images/ubuntu-24.04/vmlinuz ip=dhcp url=${base_url}/images/ubuntu-24.04/ubuntu-24.04-live-server-amd64.iso autoinstall ds=nocloud-net;s=${base_url}/autoinstall/ubuntu-24.04/type-c/
initrd ${base_url}/images/ubuntu-24.04/initrd
boot

:group_d_ubuntu2404
echo Booting Group D Ubuntu 24.04 standard autoinstall...
kernel ${base_url}/images/ubuntu-24.04/vmlinuz ip=dhcp url=${base_url}/images/ubuntu-24.04/ubuntu-24.04-live-server-amd64.iso autoinstall ds=nocloud-net;s=${base_url}/autoinstall/ubuntu-24.04/type-d/
initrd ${base_url}/images/ubuntu-24.04/initrd
boot

:shell
shell

:reboot
reboot
