playbooks: bifrost-ironic-install: Fix reboot if iPXE boot failed

If iPXE boot failed, then make sure the 'reboot' action is really
executed. The problem with 'prompt --timeout...' is that this command
will fail if no key is pressed. However, iPXE exits immediately if
one of the command fails so the 'reboot' action was never executed and
the node was stuck in the following unbootable state.

boot.ipxe : 395 bytes [script]
/pxelinux.cfg/52-54-00-23-e4-c2... No such file or directory (http://ipxe.org/2d0c613b)
/pxelinux.cfg/default... ok
Configuring (net0 52:54:00:23:e4:c2).................. Error 0x040ee119 (http://ipxe.org/040ee119)
Could not boot: Error 0x040ee119 (http://ipxe.org/040ee119)
PXE boot failed. No configuration found for MAC 52:54:00:23:e4:c2
Press any key to reboot...
Could not boot image: Connection timed out (http://ipxe.org/4c22e035)
No more network devices

Change-Id: If4b2bab25bcfe8da0a64ee9cc1659580aec9776a
This commit is contained in:
Markos Chandras 2017-02-08 11:40:31 +00:00
parent 16376f90c7
commit 69486c4f58

View File

@ -13,5 +13,5 @@ chain pxelinux.cfg/default || goto error_no_config
:error_no_config
echo PXE boot failed. No configuration found for MAC ${mac}
echo Press any key to reboot...
prompt --timeout 180
prompt --timeout 180 || reboot
reboot