#!ipxe

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

set custom_iso ${base_url}/images/ubuntu-24.04/group-a/custom-os/ubuntu-24.04-full-autoinstall.iso
set custom_kernel ${base_url}/images/ubuntu-24.04/group-a/custom-os/vmlinuz
set custom_initrd ${base_url}/images/ubuntu-24.04/group-a/custom-os/initrd

menu Provision Server

item --gap -- ---------------- Device Groups ----------------
item group_a Install device Group A
item group_b Install device Group B
item group_c Install device Group C
item group_d Install device Group D

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

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

:group_a
echo Selected: Group A
echo This will start Ubuntu 24.04 autoinstall from custom ISO.
prompt Press any key to continue with Group A installation...
kernel ${custom_kernel} initrd=initrd ip=dhcp boot=casper netboot=url url=${custom_iso} autoinstall ds=nocloud;s=/cdrom/nocloud/ ---
initrd --name initrd ${custom_initrd}
boot

:group_b
echo Selected: Group B
echo This will start Ubuntu 24.04 autoinstall from custom ISO.
prompt Press any key to continue with Group B installation...
kernel ${custom_kernel} initrd=initrd ip=dhcp boot=casper netboot=url url=${custom_iso} autoinstall ds=nocloud;s=/cdrom/nocloud/ ---
initrd --name initrd ${custom_initrd}
boot

:group_c
echo Selected: Group C
echo This will start Ubuntu 24.04 autoinstall from custom ISO.
prompt Press any key to continue with Group C installation...
kernel ${custom_kernel} initrd=initrd ip=dhcp boot=casper netboot=url url=${custom_iso} autoinstall ds=nocloud;s=/cdrom/nocloud/ ---
initrd --name initrd ${custom_initrd}
boot

:group_d
echo Selected: Group D
echo This will start Ubuntu 24.04 autoinstall from custom ISO.
prompt Press any key to continue with Group D installation...
kernel ${custom_kernel} initrd=initrd ip=dhcp boot=casper netboot=url url=${custom_iso} autoinstall ds=nocloud;s=/cdrom/nocloud/ ---
initrd --name initrd ${custom_initrd}
boot

:shell
shell

:reboot
reboot
