fcarrus / rhvh-provisioning-satellite Goto Github PK
View Code? Open in Web Editor NEWHow to do unattended provisioning of RHV Hypervisors using Satellite
How to do unattended provisioning of RHV Hypervisors using Satellite
For the record, here are changes against current upstream (summer 2020):
diff --git a/provisioning_templates/PXELinux/kickstart_ovirt_pxelinux.erb b/provisioning_templates/PXELinux/kickstart_ovirt_pxelinux.erb
index 9729ccf..724c9bd 100644
--- a/provisioning_templates/PXELinux/kickstart_ovirt_pxelinux.erb
+++ b/provisioning_templates/PXELinux/kickstart_ovirt_pxelinux.erb
@@ -1,14 +1,22 @@
<%#
-kind: PXELinux
-name: Kickstart oVirt-RHVH PXELinux
+name: Baremetal Kickstart oVirt-RHVH PXELinux
+snippet: false
model: ProvisioningTemplate
+kind: PXELinux
oses:
-- oVirt
-- RHVH
+- RedHat
+%>
+<%# TODO: Manage bonds %>
+<%
+ subnet = @host.provision_interface.subnet
+ ip = @host.provision_interface.ip
+ mask = subnet.mask
+ gw = subnet.gateway
+ dns = subnet.dns_primary
%>
DEFAULT rhvh
LABEL rhvh
KERNEL <%= @kernel %>
-APPEND initrd=<%= @initrd %> inst.ks=<%= foreman_url("provision") %> inst.stage2=<%= medium_uri %> local_boot_trigger=<%= foreman_url("built") %> intel_iommu=on
+APPEND initrd=<%= @initrd %> inst.ks=<%= foreman_url("provision") %> inst.stage2=<%= medium_uri %> local_boot_trigger=<%= foreman_url("built") %> <%= subnet.dhcp ? '' : "ip=#{ip}::#{gw}:#{mask}:#{@host}::none nameserver=#{dns}" %> intel_iommu=on
IPAPPEND 2
diff --git a/provisioning_templates/provision/kickstart_ovirt.erb b/provisioning_templates/provision/kickstart_ovirt.erb
index 40eb689..8ad3710 100644
--- a/provisioning_templates/provision/kickstart_ovirt.erb
+++ b/provisioning_templates/provision/kickstart_ovirt.erb
@@ -1,6 +1,6 @@
<%#
kind: provision
-name: Kickstart oVirt-RHVH
+name: Baremetal Kickstart oVirt-RHVH
model: ProvisioningTemplate
oses:
- oVirt
@@ -36,8 +36,6 @@ view the host is assigned to. It's also possible to provide full url,
in which case it would be used without a change.
%>
-# This kickstart file was rendered from the Foreman provisioning template "<%= @template_name %>".
-
install
<%
liveimg_name = host_param('liveimg_name') || 'squashfs.img'
@@ -50,13 +48,14 @@ end
liveimg --url=<%= liveimg_url %>
-<% subnet = @host.subnet -%>
+<% prov_if = @host.provision_interface -%>
+<% subnet = prov_if.subnet -%>
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
<% dhcp = subnet.dhcp_boot_mode? && !@static -%>
<% else -%>
<% dhcp = !@static -%>
<% end -%>
-network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{subnet.dns_servers.join(',')}" %> --hostname <%= @host %> --device=<%= @host.mac -%>
+network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{prov_if.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{subnet.dns_servers.join(',')}" %> --hostname <%= @host %> --device=<%= prov_if.mac -%>
rootpw --iscrypted <%= root_pass %>
<% if host_param_true?('disable-firewall') -%>
@@ -76,6 +75,13 @@ reboot
%post --log=/root/ks.post.log --erroronfail
nodectl init
<%= snippet 'redhat_register' %>
+
+<% if host_enc['parameters']['realm'] && @host.realm && (@host.realm.realm_type == 'FreeIPA' || @host.realm.realm_type == 'Red Hat Identity Management') -%>
+<%= snippet 'freeipa_register' %>
+<% end -%>
+
+<%= snippet('remote_execution_ssh_keys') %>
+
<%= snippet 'kickstart_networking_setup' %>
<%= snippet 'efibootmgr_netboot' %>
/usr/sbin/ntpdate -sub <%= host_param('ntp-server') || '0.fedora.pool.ntp.org' %>
I am going to incorporate some of the changes, feel free to drop comments in the PR if you feel something is missing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.