Revision db0f5b8f
Added by Ondřej Pražák about 6 years ago
app/views/unattended/partition_tables_templates/empty.erb | ||
---|---|---|
<%#
|
||
kind: ptable
|
||
name: Empty
|
||
model: Ptable
|
||
oses:
|
||
- RancherOS
|
||
-%>
|
app/views/unattended/provisioning_templates/PXELinux/rancheros_pxelinux.erb | ||
---|---|---|
<%#
|
||
kind: PXELinux
|
||
name: RancherOS PXELinux
|
||
model: ProvisioningTemplate
|
||
oses:
|
||
- RancherOS
|
||
-%>
|
||
DEFAULT rancheros
|
||
|
||
LABEL rancheros
|
||
KERNEL <%= @kernel -%> rancher.state.dev=LABEL=RANCHER_STATE rancher.state.autoformat=[<%= host_param('install-disk') || '/dev/sda' %>] rancher.cloud_init.datasources=['url:<%= foreman_url('provision')-%>']
|
||
APPEND initrd=<%= @initrd -%>
|
app/views/unattended/provisioning_templates/finish/preseed_default_finish.erb | ||
---|---|---|
/bin/sed -i "s/.*dns-search.*/\tdns-search <%= @host.domain %>/g" /etc/network/interfaces
|
||
/bin/sed -i "s/^<%= @host.ip %>.*/<%= @host.ip %>\t<%= @host.shortname %>.<%= @host.domain %>\t<%= @host.shortname %>/g" /etc/hosts
|
||
/bin/echo <%= @host.shortname %> > /etc/hostname
|
||
/bin/hostname <%= @host.shortname %>.<%= @host.domain %>
|
||
<% end -%>
|
||
|
||
<% if host_enc['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
|
app/views/unattended/provisioning_templates/provision/atomic_kickstart_default.erb | ||
---|---|---|
<% dhcp = !@static -%>
|
||
<% end -%>
|
||
|
||
network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select{ |item| item.present? }.join(',')}" %> --hostname <%= @host %><%= " --device=#{@host.mac}" -%>
|
||
network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select{ |item| item.present? }.join(',')} --mtu=#{subnet.mtu.to_s}" %> --hostname <%= @host %><%= " --device=#{@host.mac}" -%>
|
||
|
||
# Partition table should create /boot and a volume atomicos
|
||
<% if @dynamic -%>
|
app/views/unattended/provisioning_templates/provision/kickstart_default.erb | ||
---|---|---|
- enable-epel: boolean (default=true)
|
||
- enable-puppetlabs-repo: boolean (default=false)
|
||
- enable-puppetlabs-pc1-repo: boolean (default=false)
|
||
- enable-puppetlabs-puppet5-repo: boolean (default=false)
|
||
- salt_master: string (default=undef)
|
||
- ntp-server: string (default="0.fedora.pool.ntp.org")
|
||
- bootloader-append: string (default="nofb quiet splash=quiet")
|
||
... | ... | |
section_end = (rhel_compatible && os_major <= 5) ? '' : '%end'
|
||
%>
|
||
install
|
||
<% if host_param('kickstart_liveimg') %>
|
||
liveimg --url=<%= host_param('kickstart_liveimg') %> <%= proxy_string %>
|
||
<% else %>
|
||
<%= @mediapath %><%= proxy_string %>
|
||
<% end %>
|
||
lang <%= host_param('lang') || 'en_US.UTF-8' %>
|
||
selinux --<%= host_param('selinux-mode') || host_param('selinux') || 'enforcing' %>
|
||
keyboard <%= host_param('keyboard') || 'us' %>
|
||
... | ... | |
<% else -%>
|
||
<% dhcp = !@static -%>
|
||
<% end -%>
|
||
network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select{ |item| item.present? }.join(',')}" %> --hostname <%= @host %><%= os_major >= 6 ? " --device=#{@host.mac}" : '' -%>
|
||
|
||
network --bootproto <%= dhcp ? 'dhcp' : "static --ip=#{@host.ip} --netmask=#{subnet.mask} --gateway=#{subnet.gateway} --nameserver=#{[subnet.dns_primary, subnet.dns_secondary].select{ |item| item.present? }.join(',')} --mtu=#{subnet.mtu.to_s}" %> --hostname <%= @host %><%= os_major >= 6 ? " --device=#{@host.mac}" : '' -%>
|
||
|
||
rootpw --iscrypted <%= root_pass %>
|
||
<% if host_param_true?('disable-firewall') -%>
|
app/views/unattended/provisioning_templates/provision/kickstart_ovirt.erb | ||
---|---|---|
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.
|
||
%>
|
||
|
||
install
|
||
liveimg --url=<%= @host.operatingsystem.medium_uri(@host) %>/<%= @host.params['liveimg_name'] || 'squashfs.img' %>
|
||
<%
|
||
liveimg_name = host_param('liveimg_name') || 'squashfs.img'
|
||
if host_param('kt_activation_keys')
|
||
liveimg_url = repository_url(liveimg_name, 'isos')
|
||
else
|
||
liveimg_url = "#{@host.operatingsystem.medium_uri(@host)}/#{liveimg_name}"
|
||
end
|
||
%>
|
||
|
||
liveimg --url=<%= liveimg_url %>
|
||
|
||
<% subnet = @host.subnet -%>
|
||
<% if subnet.respond_to?(:dhcp_boot_mode?) -%>
|
||
... | ... | |
|
||
%post --log=/root/ks.post.log --erroronfail
|
||
nodectl init
|
||
<%= snippet 'subscription_manager_registration' if @host.operatingsystem.name == 'RHVH' %>
|
||
<%= snippet 'redhat_register' %>
|
||
<%= snippet 'kickstart_networking_setup' %>
|
||
/usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || '0.fedora.pool.ntp.org' %>
|
||
/usr/sbin/hwclock --systohc
|
app/views/unattended/provisioning_templates/provision/rancheros_provision.erb | ||
---|---|---|
<%#
|
||
kind: provision
|
||
name: RancherOS provision
|
||
model: ProvisioningTemplate
|
||
oses:
|
||
- RancherOS
|
||
-%>
|
||
<%= snippet 'rancheros_cloudconfig' -%>
|
app/views/unattended/provisioning_templates/snippet/_kickstart_ifcfg_generic_interface.erb | ||
---|---|---|
<%- elsif @interface.virtual? && !@subnet.nil? && !@subnet.has_vlanid? && @interface.identifier.include?(':') -%>
|
||
<%= "TYPE=Alias" %>
|
||
<%- end -%>
|
||
<%- if @subnet -%>
|
||
<%= "MTU=#{@subnet.mtu}" %>
|
||
<%- elsif @subnet6 -%>
|
||
<%= "MTU=#{@subnet6.mtu}" %>
|
||
<%- end -%>
|
app/views/unattended/provisioning_templates/snippet/_rancheros_cloudconfig.erb | ||
---|---|---|
<%#
|
||
kind: snippet
|
||
name: rancheros_cloudconfig
|
||
model: ProvisioningTemplate
|
||
snippet: true
|
||
-%>
|
||
#cloud-config
|
||
hostname: <%= @host.shortname %>
|
||
rancher:
|
||
network:
|
||
dns:
|
||
nameservers:
|
||
<% if @host.subnet.dns_primary.present? or @host.subnet.dns_secondary.present? -%>
|
||
<% if @host.subnet.dns_primary.present? -%>
|
||
- <%= @host.subnet.dns_primary %>
|
||
<% end -%>
|
||
<% if @host.subnet.dns_secondary.present? -%>
|
||
- <%= @host.subnet.dns_secondary %>
|
||
<% end -%>
|
||
<% end -%>
|
||
search:
|
||
- <%= @host.domain %>
|
||
interfaces:
|
||
eth*:
|
||
dhcp: true
|
||
<% unless @host.subnet.respond_to?(:dhcp_boot_mode?) -%>
|
||
eth0:
|
||
address: <%= @host.ip -%>/<%= @host.subnet.cidr %>
|
||
gateway: <%= @host.subnet.gateway %>
|
||
<% end -%>
|
||
console: debian
|
||
ssh_authorized_keys:
|
||
<%-
|
||
users = @host.owner_type == 'Usergroup' ? @host.owner.all_users : [@host.owner]
|
||
users.each do |user|
|
||
if user.respond_to?(:ssh_authorized_keys) && user.ssh_authorized_keys.any?
|
||
index = 0
|
||
user.ssh_keys.each do |key|
|
||
if index == 0
|
||
-%>
|
||
<%=" - #{key.type} #{key.ssh_key} #{key.comment}"%>
|
||
<%-
|
||
else
|
||
-%>
|
||
<%=" - #{key.type} #{key.ssh_key} #{key.comment} - #{index}"%>
|
||
<%-
|
||
end
|
||
index += 1
|
||
end
|
||
end
|
||
end
|
||
-%>
|
Also available in: Unified diff
Sync templates from community-templates