Sha256: 88d80a396dfa38f5afe5997320a0cf079eb7f3f225e20b729365f0924100c177

Contents?: true

Size: 1.55 KB

Versions: 1

Compression:

Stored size: 1.55 KB

Contents

<%#
kind: kexec
name: Red Hat kexec
oses:
- CentOS 4
- CentOS 5
- CentOS 6
- CentOS 7
- Fedora 21
- Fedora 22
- Fedora 23
- Fedora 24
- RedHat 4
- RedHat 5
- RedHat 6
- RedHat 7
-%>
<%#
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 three items:
"kernel", "initram" and "append". Read kexec(8) man page for more
information about semantics.
-%>
<%
  @kernel, @initrd = @host.operatingsystem.boot_files_uri(@host.medium, @host.architecture)
  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']
-%>
{
  "kernel": "<%= @kernel %>",
  "initram": "<%= @initrd %>",
<% if (@host.operatingsystem.name == 'Fedora' and @host.operatingsystem.major.to_i > 16) or
    (@host.operatingsystem.name != 'Fedora' and @host.operatingsystem.major.to_i >= 7) -%>
  "append": "ks=<%= foreman_url('provision') + "&static=yes" %> inst.ks.sendmac <%= "ip=#{ip}::#{gw}:#{mask}:::none nameserver=#{dns} ksdevice=bootif BOOTIF=#{bootif} nomodeset #{append}" %>"
<% else -%>
  "append": "ks=<%= foreman_url('provision') + "&static=yes" %> kssendmac nicdelay=5 <%= "ip=#{ip} netmask=#{mask} gateway=#{gw} dns=#{dns} ksdevice=#{mac} BOOTIF=#{bootif} nomodeset #{append}" %>"
<% end -%>
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_discovery-6.0.0 app/views/foreman_discovery/redhat_kexec.erb