<%# kind: provision name: PE Kickstart Default oses: - Red Hat Enterprise Linux 5 - Red Hat Enterprise Linux 6 - Red Hat Enterprise Linux 7 %> <% rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora' os_major = @host.operatingsystem.major.to_i section_end = (rhel_compatible && os_major <= 5) ? '' : '%end' %> install <%= @mediapath %> lang en_US.UTF-8 selinux --enforcing keyboard us skipx network --bootproto <%= @static ? "static --ip=#{@host.ip} --netmask=#{@host.subnet.mask} --gateway=#{@host.subnet.gateway} --nameserver=#{[@host.subnet.dns_primary,@host.subnet.dns_secondary].reject{|n| n.blank?}.join(',')}" : 'dhcp' %> --hostname <%= @host %> rootpw --iscrypted <%= root_pass %> firewall --<%= os_major >= 6 ? 'service=' : '' %>ssh authconfig --useshadow --passalgo=sha256 --kickstart timezone --utc <%= @host.params['time-zone'] || 'UTC' %> bootloader --location=mbr --append="nofb quiet splash=quiet" <%= grub_pass %> <% if os_major == 5 -%> key --skip <% end -%> <% if @dynamic -%> %include /tmp/diskpart.cfg <% else -%> <%= @host.diskLayout %> <% end -%> text reboot %packages --ignoremissing yum dhclient ntp wget @Core <%= section_end -%> <% if @dynamic -%> %pre <%= @host.diskLayout %> <%= section_end -%> <% end -%> %post --nochroot exec < /dev/tty3 > /dev/tty3 #changing to VT 3 so that we can see whats going on.... /usr/bin/chvt 3 ( cp -va /etc/resolv.conf /mnt/sysimage/etc/resolv.conf /usr/bin/chvt 1 ) 2>&1 | tee /mnt/sysimage/root/install.postnochroot.log <%= section_end -%> %post logger "Starting anaconda <%= @host %> postinstall" exec < /dev/tty3 > /dev/tty3 #changing to VT 3 so that we can see whats going on.... /usr/bin/chvt 3 ( #update local time echo "updating system time" /usr/sbin/ntpdate -sub <%= @host.params['ntp-server'] || '0.fedora.pool.ntp.org' %> /usr/sbin/hwclock --systohc <%= snippet "subscription_manager_registration" %> #<% if @host.respond_to?(:realm) && @host.respond_to?(:otp) && @host.realm && @host.otp && @host.realm.realm_type == "Red Hat Identity Management" -%> #<%= snippet "idm_register" %> #<% end -%> # update all the base packages from the updates repository #yum -t -y -e 0 update # and add the puppet package yum -t -y -e 0 install puppet-agent echo "Setting Puppet Certificate Extensions" cat > /etc/puppetlabs/puppet/csr_attributes.yaml << EOF <%= snippet 'puppet_csr_attributes.yaml' %> EOF echo "Configuring puppet" cat > /etc/puppetlabs/puppet/puppet.conf << EOF <%= snippet 'pe-puppet.conf' %> EOF sync <% if @provisioning_type == nil || @provisioning_type == 'host' -%> # Inform the build system that we are done. echo "Informing Satellite that we are built" wget -q -O /dev/null --no-check-certificate <%= foreman_url %> <% end -%> ) 2>&1 | tee /root/install.post.log exit 0 <%= section_end -%>