|
<%#
|
|
kind: finish
|
|
name: Kickstart default finish
|
|
oses:
|
|
- CentOS
|
|
- Fedora
|
|
%>
|
|
<%#
|
|
This template accepts the following parameters:
|
|
- bootloader-append: string (default="nofb quiet splash=quiet")
|
|
- force-puppet: boolean (default=false)
|
|
- ntp-server: string (default="0.fedora.pool.ntp.org")
|
|
- package_upgrade: boolean (default=true)
|
|
- salt_master: string (default=undef)
|
|
%>
|
|
<% if @host.subnet.respond_to?(:dhcp_boot_mode?) -%>
|
|
<%= snippet 'kickstart_networking_setup' %>
|
|
service network restart
|
|
<% end -%>
|
|
|
|
<%
|
|
rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
|
|
os_major = @host.operatingsystem.major.to_i
|
|
pm_set = @host.puppetmaster.empty? ? false : true
|
|
puppet_enabled = pm_set || @host.param_true?('force-puppet')
|
|
salt_enabled = @host.params['salt_master'] ? true : false
|
|
chef_enabled = @host.respond_to?(:chef_proxy) && @host.chef_proxy
|
|
%>
|
|
|
|
<% if @host.provision_method == 'image' && root_pass.present? -%>
|
|
# Install the root password
|
|
echo 'root:<%= root_pass -%>' | /usr/sbin/chpasswd -e
|
|
<% end -%>
|
|
|
|
<% if rhel_compatible -%>
|
|
<%= snippet 'epel' -%>
|
|
<% end -%>
|
|
|
|
#update local time
|
|
echo "updating system time"
|
|
/usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || '0.fedora.pool.ntp.org' %>
|
|
/usr/sbin/hwclock --systohc
|
|
|
|
<% if @host.info['parameters']['realm'] && @host.realm && @host.realm.realm_type == 'FreeIPA' -%>
|
|
<%= snippet 'freeipa_register' %>
|
|
<% end -%>
|
|
|
|
<% unless @host.param_false?('package_upgrade') -%>
|
|
# update all the base packages from the updates repository
|
|
if [ -f /usr/bin/dnf ]; then
|
|
dnf -y update
|
|
else
|
|
yum -t -y update
|
|
fi
|
|
<% end -%>
|
|
|
|
<%= snippet('remote_execution_ssh_keys') %>
|
|
|
|
<% if chef_enabled %>
|
|
<%= snippet 'chef_client' %>
|
|
<% end -%>
|
|
|
|
<% if puppet_enabled %>
|
|
<%= snippet 'puppetlabs_repo' %>
|
|
<%= snippet 'puppet_setup' %>
|
|
<% end -%>
|
|
|
|
<% if salt_enabled %>
|
|
<%= snippet 'saltstack_setup' %>
|
|
<% end -%>
|
|
|
|
sync
|
|
|
|
exit 0
|