create_authkeys() {
echo
-
local url="${COBBLER_URL}/custom/create-vmware-tpl/keys/auth_keys_pp_betrieb"
log "Creating /root/.ssh ..."
#-----------------------------------------------------------
create_etc_hosts() {
+ echo
log "Generating /etc/hosts ..."
cat <<-EOF >/etc/hosts
#-----------------------------------------------------------
manage_dns() {
+ echo
log "Generating /etc/resolv.conf ..."
if [[ -f /etc/resolv.conf ]] ; then
mv -v /etc/resolv.conf "/etc/resolv.conf.orig.$( date -r /etc/resolv.conf +'%Y-%m-%d_%H:%M:%S' )"
}
+#-----------------------------------------------------------
+install_epel() {
+
+ echo
+ log "Install EPEL repository package ..."
+
+ local url="${COBBLER_URL}/custom/epel/7/x86_64/epel-release-7-5.noarch.rpm"
+ echo "Using URL '${url}' ..."
+
+ yum install -y "${url}"
+
+ log "Updating YUM cache ..."
+ yum makecache
+
+ log "Installing perl-Config-IniFiles.noarch ..."
+ yum install -y perl-Config-IniFiles.noarch
+ sleep 3
+
+}
+
+#-----------------------------------------------------------
+install_pp_tcsh_env() {
+
+ echo
+ log "Pulling pixelpark TCSH config .."
+
+ local cdir=$(pwd)
+ local url="${COBBLER_URL}/custom/shell/linux_tcsh.tar"
+ local local_tar=$( mktemp -p /tmp "linux_tcsh.XXXXXXXX.tar" )
+
+ echo "Local tar file: '${local_tar}'."
+ wget -O "${local_tar}" --dns-timeout=2 --connect-timeout=3 --read-timeout=3 "${url}" || true
+ if [[ -f "${local_tar}" && -s "${local_tar}" ]] ; then
+ cd /etc
+ echo "Unpacking '${local_tar}' ..."
+ sleep 1
+ tar xvf "${local_tar}"
+ mv -v /etc/.cshrc /etc/csh.cshrc
+ fi
+ rm -fv "${local_tar}"
+
+}
+
+#-----------------------------------------------------------
+make_pp_dirs() {
+ echo
+ log "Creating Pixelpark directories ..."
+ for bname in bin etc man ; do
+ mkdir -pv "/opt/PPlocal/${bname}"
+ done
+}
+
+#-----------------------------------------------------------
+misc_packages() {
+
+ local misc_pkgs="ksh tmux vim telnet curl"
+
+ echo
+ log "Installing NetworkManager ..."
+ yum install -y NetworkManager NetworkManager-config-server NetworkManager-tui
+ echo "Enabling NetworkManager ..."
+ systemctl enable NetworkManager
+
+ echo
+ log "Removing iptables-services ..."
+ yum remove -y install iptables-services
+ echo "Stopping and disabling firewalld ..."
+ systemctl stop firewalld
+ systemctl disable firewalld
+
+ echo
+ log "Installng VLAN vconfig ..."
+ yum install -y vconfig
+
+ echo
+ log "Installing packages: ${misc_pkgs}"
+ yum install -y ${misc_pkgs}
+
+}
+
+#-----------------------------------------------------------
+create_motd() {
+
+ local url="${COBBLER_URL}/custom/pp-scripts/mk_create_motd.ksh"
+
+ echo
+ log "Creating initial /etc/motd ..."
+ wget -qO- "${url}" | ksh > /etc/motd
+
+}
+
#-----------------------------------------------------------
main() {
install_network
manage_dns
tweak_systemd
-
+ install_epel
+ install_pp_tcsh_env
+ make_pp_dirs
+ misc_packages
+ create_motd
tweak_grub