Project

General

Profile

Download (3.29 KB) Statistics
| Branch: | Tag: | Revision:
<%#
kind: provision
name: Kickstart oVirt-RHVH
model: ProvisioningTemplate
oses:
- oVirt
- RHVH
description: |
Provisioning template for oVirt Node and Red Hat Virtualization Host. It renders the kickstart
file.

This template accepts the following parameters:
- liveimg_name: string (default=squashfs.img)
- lang: string (default="en_US.UTF-8")
- selinux-mode: string (default="enforcing")
- keyboard: string (default="us")
- time-zone: string (default="UTC")
- ntp-server: string (default="0.fedora.pool.ntp.org")
- disable-firewall: boolean (default=false)

This kickstart will only work with LVM THIN partitioning ('Kickstart default thin')
and it requires the installation URL to have squashfs.img image extracted in the
root folder (or specified via 'liveimg_name' parameter). See oVirt Node documentation
or RHV Installation Manual, section 5.2. Advanced installation.

By default, the template expects the squashfs.img to be present inside
the installation media. When using Katello for content management (the
kt_activation_key parameter is set), the liveimg_name is used to
specify relative path to the file and the template use repository_url
helper to generate an absolute path to the file (taking into account
also info about the content proxy relevant for the host)

For example, in case the squashfs.img is uploaded inside custom
product named 'oVirt' and repository 'hypervisor', the
liveimg_name would be 'custom/ovirt/hypervisor/squashfs.img'.
In this case, this repository would need to be part of the content
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'
if host_param('kt_activation_keys')
liveimg_url = repository_url(liveimg_name, 'isos')
else
liveimg_url = "#{medium_uri}/#{liveimg_name}"
end
%>

liveimg --url=<%= liveimg_url %>

<%
# start with provisioning interface, then other non-bond interfaces and the bonds at the end
@host.managed_interfaces.sort_by { |iface| (iface.bond? || iface.bridge?) 0 : iface.provision? 20 : 10 }.each |iface| do
%>
<%= snippet(
'kickstart_network_interface',
variables: {
iface: iface,
host: @host,
use_slaac: false,
static: @static,
static6: @static6
}
) -%>
<%
end
-%>


rootpw --iscrypted <%= root_pass %>
<% if host_param_true?('disable-firewall') -%>
firewall --disable
<% else -%>
firewall --service=ssh
<% end -%>
lang <%= host_param('lang') || 'en_US.UTF-8' %>
timezone --utc <%= host_param('time-zone') || 'UTC' %>
selinux --<%= host_param('selinux-mode') || host_param('selinux') || 'enforcing' %>
keyboard <%= host_param('keyboard') || 'us' %>
services --enabled=sshd
text
reboot
<%= @host.diskLayout %>

%post --log=/root/ks.post.log --erroronfail
nodectl init
<%= snippet 'redhat_register' %>
<%= snippet 'efibootmgr_netboot' %>
<% if host_param_true?('host_registration_insights') -%>
<%= snippet 'insights' -%>
<% end -%>

/usr/sbin/ntpdate -sub <%= host_param('ntp-server') || '0.fedora.pool.ntp.org' %>
/usr/sbin/hwclock --systohc

/usr/bin/curl <%= foreman_url('built') %>
sync
systemctl reboot
%end
(9-9/13)