What happens if PXE is set first in BIOS? Does this post section still work as expected? I think it will break that
configuration.
Here's a node, where I set in BIOS the boot order for IPv4 PXE to be first.
[root@compute-0-0 ~]# efibootmgr
BootCurrent: 0001
Timeout: 5 seconds
BootOrder: 0002,0004,0001,0006,0003,0005,0000
Boot0000* Windows Boot Manager
Boot0001* Rocks
Boot0002* UEFI: IP4 Realtek PCIe GBE Family Controller
Boot0003 UEFI: IP6 Realtek PCIe GBE Family Controller
Boot0004* UEFI: IP4 Realtek PCIe GBE Family Controller
Boot0005 UEFI: IP6 Realtek PCIe GBE Family Controller
Boot0006* CentOS
I'm going to reinstall this node and see if I get the same result. (I would expect so).
I'm just trying to understand how to set this automatically WITHOUT messing things up That one can
change the boot order from the OS when it's EFI is pretty cool :-).
If I run your script on this node: The new BootOrder would be 0004,0002,0001, ....
which just flips the first two. (not bad in this case), but if it were in BIOS as
0002,0001, .... initially, your script would have opposite of what was intended. Disk would become first, not network.
I'm also not sure that keying off of 'Rocks' is generally applicable, either, Since a roll might install an updated kernel in a post
or otherwise do some changing of grub2.conf.
-P