Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. <%#
  2. kind: PXEGrub2
  3. name: Kickstart default PXEGrub2
  4. model: ProvisioningTemplate
  5. oses:
  6. - CentOS
  7. - Fedora
  8. - RedHat
  9. -%>
  10. # This file was deployed via '<%= template_name %>' template
  11.  
  12. <%
  13. major = @host.operatingsystem.major.to_i
  14. mac = @host.provision_interface.mac
  15.  
  16. # Tell Anaconda to perform network functions with boot interface
  17. # both current and legacy syntax provided
  18. options = ["network", "ksdevice=bootif", "ks.device=bootif"]
  19. if mac
  20. bootif = '00-' + mac.gsub(':', '-')
  21. options.push("BOOTIF=#{bootif}")
  22. end
  23.  
  24. # Tell Anaconda what to pass off to kickstart server
  25. # both current and legacy syntax provided
  26. options.push("kssendmac", "ks.sendmac", "inst.ks.sendmac")
  27.  
  28. # handle non-DHCP environments (e.g. bootdisk)
  29. subnet = @host.provision_interface.subnet
  30. unless subnet.dhcp_boot_mode?
  31. # static network configuration
  32. ip = @host.provision_interface.ip
  33. mask = subnet.mask
  34. gw = subnet.gateway
  35. dns = [subnet.dns_primary]
  36. if subnet.dns_secondary != ''
  37. dns.push(subnet.dns_secondary)
  38. end
  39. if (@host.operatingsystem.name.match(/Fedora/i) && major < 17) || major < 7
  40. # old Anacoda found in Fedora 16 or RHEL 6 and older
  41. dns_servers = dns.join(',')
  42. options.push("ip=#{ip}", "netmask=#{mask}", "gateway=#{gw}", "dns=#{dns_servers}")
  43. else
  44. options.push("ip=#{ip}::#{gw}:#{mask}:::none")
  45. dns.each { |server|
  46. options.push("nameserver=#{server}")
  47. }
  48. end
  49. end
  50.  
  51. # optional repository for Atomic
  52. if @host.operatingsystem.name.match(/Atomic/i)
  53. options.push("inst.repo=#{@host.operatingsystem.medium_uri(@host)}")
  54. end
  55.  
  56. if host_param('blacklist')
  57. options.push("modprobe.blacklist=" + host_param('blacklist').gsub(' ', ''))
  58. end
  59.  
  60. ksoptions = options.join(' ')
  61. -%>
  62.  
  63. set default=0
  64. set timeout=<%= host_param('loader_timeout') || 10 %>
  65.  
  66. menuentry '<%= template_name %>' {
  67. linuxefi <%= @kernel %> ks=<%= foreman_url('provision') %> <%= pxe_kernel_options %> <%= ksoptions %>
  68. initrdefi <%= @initrd %>
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement