url_for_boot not defined for Debian based OSes
<pujan14> Hi I was wondering if "http://blog.theforeman.org/2012/01/re-provision-host-without-pxeboot.html" only works with kickstart besed OSes?
<pujan14> I tried with debian on my current installation and gave me error "undefined method `url_for_boot'"
-> the Grubby script coming with foreman is using url_for_boot, but tat's not defined for Debian based OSes
#1 Updated by Matt Klich over 4 years ago
Fixing the template is pretty easy. I got it to look right with:
<% kernel, initrd = @host.operatingsystem.boot_files_uri(@host.medium,@host.architecture) -%> wget -O "$KERNEL" "<%= kernel %>" wget -O "$INITRD" "<%= initrd %>"
However, grubby isn't available in Debian. It may or may not be available in Ubuntu; I don't run it so I don't know.
#4 Updated by Ronald van Zantvoort about 4 years ago
The opposite is also true; @host.operatingsystem.boot_files_uri(@host.medium,@host.architecture) won't work on RH systems, which means that for example for a Red Hat PXELinux ONLY
<% kernel = @host.url_for_boot(:kernel) initrd = @host.url_for_boot(:initrd) -%> KERNEL <%= kernel %> INITRD <%= initrd %>
While for a Debian ONLY
<% kernel, initrd = @host.operatingsystem.boot_files_uri(@host.medium,@host.architecture) -%> KERNEL <%= kernel %> INITRD <%= initrd %>
Kinda confusing if you ask me ;)
#5 Updated by Michael Moll about 4 years ago
That can be handled via ERB in templates. In fact that's necessary as ks=... won't work for Debian or SUSE. The problem I'm having is, that accessing boot_files_uri() requires to have safemode disabled, so that's not a way to go. I lean towards closing that issue with the lame excuse of grubby not being packaged in Debian/Ubuntu...