--- /dev/null
+######################################################################################
+# Provisioning-Installation of {{ distro.description }}
+######################################################################################
+#
+# Standard Pixelpark Installation of {{ distro.name }} templates.
+#
+
+# Firewall configuration
+firewall --disabled
+
+# Use network installation from cobbler host
+url --url="{{ distro.ks_repo_url }}" --noverifyssl
+
+sshpw --username=inst testtest --plaintext
+
+# Root install-password
+rootpw --iscrypted ${ROOT_PWD_HASH}
+
+# System authorization information
+authselect minimal with-mkhomedir with-pwhistory without-nullok
+
+# Use text mode install
+text
+
+# System keyboard
+keyboard --vckeymap=de-deadacute
+
+# System language
+lang en_US
+
+# SELinux configuration
+selinux --permissiv
+
+# Do not configure the X Window System
+skipx
+
+# Reboot after installation
+reboot
+
+# System timezone
+timezone Europe/Berlin
+
+###########################################
+# Partitioning and Disk
+
+# Clear the Master Boot Record
+zerombr
+
+# System bootloader configuration
+bootloader --location=mbr --append="crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M"
+
+# Partition clearing information
+clearpart --all --drive=sda --initlabel
+
+# Disk partitioning information
+part /boot --fstype ext4 --size=512 --ondisk=sda --asprimary
+part pv.01 --size=1 --grow --ondisk=sda
+volgroup vgroot pv.01
+logvol / --vgname=vgroot --name=root --fstype=xfs --size=6144
+logvol swap --vgname=vgroot --name=swap --fstype=swap --size=${SWAP_SIZE_MB}
+logvol /home --vgname=vgroot --name=home --fstype=xfs --size=1024
+logvol /var --vgname=vgroot --name=var --fstype=xfs --size=4096 --grow
+logvol /var/log --vgname=vgroot --name=log --fstype=xfs --size=3072
+
+##########################################
+# Packages
+
+%packages --exclude-weakdeps
+{%- for package in distro.packages %}
+{{ package }}
+{%- endfor %}
+%end
+
+##########################################
+# Pre tasks
+%pre --interpreter=/bin/bash --log=/var/log/ks-pre.log
+#raw
+
+echo
+echo "###########################################################"
+echo "Pre-all tasks ..."
+echo
+echo "[$( date --rfc-3339=seconds )]: Let's launch the missle ..."
+echo
+if grep '^nameserver' /etc/resolv.conf >/dev/null ; then
+ echo "Nameservers are defined in /etc/resolv.conf:"
+ grep '^nameserver' /etc/resolv.conf
+else
+ echo "Adding nameservers 93.188.109.12, 93.188.104.82 and 217.66.52.10 to /etc/resolv.conf ..."
+ echo "nameserver 93.188.109.12" >>/etc/resolv.conf
+ echo "nameserver 93.188.104.82" >>/etc/resolv.conf
+ echo "nameserver 217.66.52.10" >>/etc/resolv.conf
+fi
+
+echo
+echo "Used /etc/resolv.conf:"
+cat /etc/resolv.conf
+
+echo
+echo "Linux uname:"
+uname -a
+
+echo
+echo "Linux kernel versions:"
+rpm -qa | grep -i kernel | sort -i
+
+echo
+echo "Devices:"
+echo
+ls -lA /dev/disk/*/
+
+#end raw
+%end
+
+##########################################
+# Pre installation tasks
+%pre-install --interpreter=/bin/bash --log=/var/log/ks-pre-install.log
+#raw
+echo
+echo "###########################################################"
+echo "Pre install tasks ..."
+echo
+
+echo "[$( date --rfc-3339=seconds )]: Pre installation tasks ..."
+
+#end raw
+%end
+
+##########################################
+# Post installation tasks in chroot env
+
+%post --interpreter=/usr/bin/bash
+
+### output to console
+mkdir -p -v "/var/log/anaconda"
+clear
+POST_LOG="/var/log/anaconda/post-install.log"
+exec < /dev/console &> >(tee -a "$POST_LOG")
+
+######################################################################################
+# Installation of pixelpark standard applications
+######################################################################################
+
+
+### debug
+# set -x
+
+#raw
+echo
+echo "###########################################################"
+echo "Post install tasks ..."
+echo
+
+echo "cobbler profile = $profile_name"
+
+echo
+echo "IP interfaces"
+ip link show
+
+echo
+echo "IP addresses"
+ip address show
+
+echo
+echo "IPv4 routes"
+ip route list
+
+echo
+echo "IPv6 routes"
+ip -6 route list
+
+echo
+echo "/etc/resolv.conf"
+cat /etc/resolv.conf
+
+if [[ -d "/etc/yum.repos.d" ]] ; then
+
+ echo
+ echo "/etc/yum.repos.d/"
+ ls -lA /etc/yum.repos.d
+
+ for repo_file in /etc/yum.repos.d/*.repo ; do
+ if [[ -f "${repo_file}" ]] ; then
+ echo
+ echo "${repo_file}"
+ echo '---'
+ cat "${repo_file}"
+ echo '---'
+ fi
+ done
+
+fi
+
+echo
+echo "------------------"
+echo "Linux kernel versions:"
+rpm -qa | grep -i kernel | sort -i
+
+echo
+echo "------------------"
+echo "Default kernel in GRUB:"
+grubby --default-index
+grubby --default-title
+grubby --default-kernel
+
+echo
+echo "------------------"
+echo "LVM:"
+
+echo
+echo "pvs"
+pvs --units m
+
+echo
+echo "vgs"
+vgs --units m
+
+echo
+echo "lvs"
+lvs --units m
+#end raw
+
+### remove unnecessary directory
+rm -rf /var/var
+
+export hostname="$hostname"
+export system_name="$system_name"
+export gateway="$gateway"
+export mgmt_interface="eth0"
+export ip_address_eth0="$ip_address_eth0"
+export mac_address_eth0="$mac_address_eth0"
+export system_status="${SYSTEM_STATUS}"
+export ws_rel_filesdir="${WS_REL_FILESDIR}"
+export cobbler_url="${COBBLER_URL}"
+{% if distro.is_rhel %}
+export rhsm_user="${RHSM_USER}"
+export rhsm_pwd="${RHSM_PWD}"
+export rhsm_system_id="${RHSM_SYSTEM_ID}"
+export rhsm_registred=''
+
+export redhat_repo_server='https://cdn.redhat.com'
+if [[ -n "${REDHAT_REPO_SERVER}" ]] ; then
+ redhat_repo_server="${REDHAT_REPO_SERVER}"
+fi
+
+export redhat_repo_path_prefix='/content'
+if [[ -n "${REDHAT_REPO_PATH_PREFIX}" ]] ; then
+ redhat_repo_path_prefix="${REDHAT_REPO_PATH_PREFIX}"
+fi
+
+export redhat_gpg_key='file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release'
+if [[ -n "${REDHAT_GPG_KEY}" ]] ; then
+ redhat_gpg_key="${REDHAT_GPG_KEY}"
+fi
+
+{% endif %}
+echo
+echo "------------------"
+echo "hostname: '$hostname'"
+echo "system_name: '$system_name'"
+echo "gateway: '$gateway'"
+echo "Management interface: '${mgmt_interface}'"
+echo "ip_address_eth0: '$ip_address_eth0'"
+echo "mac_address_eth0: '$mac_address_eth0'"
+echo "System status: '${system_status}'"
+echo "Cobbler URL: '${cobbler_url}'"
+{% if distro.is_rhel %}
+echo
+echo "RedHat SubscriptionManager User: '${rhsm_user}'"
+echo "RedHat SubscriptionManager System ID: '${rhsm_system_id}'"
+echo "RedHat repository server: '${redhat_repo_server}'"
+echo "RedHat repository path prefix: '${redhat_repo_path_prefix}'"
+echo "RedHat GPK key: '${redhat_gpg_key}'"
+{% endif %}
+
+#raw
+echo
+echo "Mangling /etc/lvm/lvm.conf ..."
+sed -i -e 's/^\(.*\)# use_devicesfile.*/\1use_devicesfile = 0/' /etc/lvm/lvm.conf
+echo
+grep -C 2 devicesfile /etc/lvm/lvm.conf
+#end raw
+
+###############################################################################
+# Performing snippets
+
+{%- for snippet in snippets %}
+
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/{{ snippet }}"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+{%- endfor %}
+
+# ###########################
+# Seems to be finished
+
+%end
+
+##########################################
+# Second post install section without chroot
+
+%post --nochroot
+#raw
+
+mkdir -pv /mnt/sysroot/var/log/anaconda
+
+for f in /var/log/ks-pre.log /var/log/ks-pre-install.log /var/log/anaconda/post-install.log ; do
+ if test -f "${f}" : then
+ cp -pv "${f}" /mnt/sysroot/var/log/anaconda/
+ else
+ echo "File '${f}' not found!"
+ fi
+done
+
+#end raw
+%end
+
+# vim: filetype=kickstart