From: Frank Brehm Date: Wed, 28 Mar 2018 13:12:49 +0000 (+0200) Subject: Implementing install_epel, install_pp_tcsh_env, make_pp_dirs, misc_packages and creat... X-Git-Tag: 0.1.1~77 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=2beaa6793ce9bf02261e230024509b0fccd6ac63;p=pixelpark%2Fcreate-vmware-tpl.git Implementing install_epel, install_pp_tcsh_env, make_pp_dirs, misc_packages and create_motd in bin/postinst --- diff --git a/bin/postinst b/bin/postinst index e26693d..b35ba7a 100644 --- a/bin/postinst +++ b/bin/postinst @@ -36,7 +36,6 @@ log() { create_authkeys() { echo - local url="${COBBLER_URL}/custom/create-vmware-tpl/keys/auth_keys_pp_betrieb" log "Creating /root/.ssh ..." @@ -92,6 +91,7 @@ import_ssh_hostkeys() { #----------------------------------------------------------- create_etc_hosts() { + echo log "Generating /etc/hosts ..." cat <<-EOF >/etc/hosts @@ -213,6 +213,7 @@ install_network() { #----------------------------------------------------------- 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' )" @@ -270,6 +271,97 @@ tweak_grub() { } +#----------------------------------------------------------- +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() { @@ -281,7 +373,11 @@ main() { install_network manage_dns tweak_systemd - + install_epel + install_pp_tcsh_env + make_pp_dirs + misc_packages + create_motd tweak_grub