Sha256: 91fa037b20e62dc6778a5df1796f078c8d2680dc31cac2b2732cceb2642a9984

Contents?: true

Size: 1.71 KB

Versions: 4

Compression:

Stored size: 1.71 KB

Contents

<%#
kind: kexec
name: Debian kexec
oses:
- Debian
- Ubuntu
-%>
<%#
This template is used to pass command line options to kexec when reloading
kernel on a discovered host instead of rebooting. This is useful in PXE-less
environments. The template must generate JSON format with the following items
"kernel", "initram", "append" and "extra". The kexec command is composed in
the following way:

kexec --force --reset-vga --append=$append --initrd=$initram $extra $kernel

Please read kexec(8) man page for more information about semantics.
-%>
<%
  mac = @host.facts['discovery_bootif']
  bootif = '00-' + mac.gsub(':', '-') if mac
  ip_cidr = @host.facts['discovery_ip_cidr']
  ip = @host.facts['discovery_ip']
  mask = @host.facts['discovery_netmask']
  gw = @host.facts['discovery_gateway']
  dns = @host.facts['discovery_dns']
  append = @host.facts['append']
  options = ["auto=true"]
  options << "domain=#{@host.domain}"
  options << 'console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us localechooser/translation/warn-light=true localechooser/translation/warn-severe=true'
  options << "locale=#{@host.params['lang'] || 'en_US'}"
-%>
{
  "comment": "WARNING: Both kernel and initram are not set in preview mode due to http://projects.theforeman.org/issues/19737",
  "kernel": "<%= @kexec_kernel %>",
  "initram": "<%= @kexec_initrd %>",
  "append": "url=<%= foreman_url('provision') + "&static=yes" %> interface=<%= mac %> netcfg/get_ipaddress=<%= ip %> netcfg/get_netmask=<%= mask %> netcfg/get_gateway=<%= gw %> netcfg/get_nameservers=<%= dns %> netcfg/disable_dhcp=true netcfg/get_hostname=<%= @host.name %> BOOTIF=<%= bootif %> <%= options.join(' ') %>",
  "extra": []
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_discovery-13.0.1 app/views/foreman_discovery/debian_kexec.erb
foreman_discovery-12.0.2 app/views/foreman_discovery/debian_kexec.erb
foreman_discovery-12.0.1 app/views/foreman_discovery/debian_kexec.erb
foreman_discovery-12.0.0 app/views/foreman_discovery/debian_kexec.erb