#!/bin/bash
-HASH_LINE="###############################"
+HASH_LINE="#######################################################################################"
COBBLER_URL="http://192.168.88.8"
echo "$(date --rfc-3339=seconds): Das ist das Post-Install-Script '$0'."
#-----------------------------------------------------------
create_authkeys() {
+ echo
+ echo "${HASH_LINE}"
echo
local url="${COBBLER_URL}/custom/create-vmware-tpl/keys/auth_keys_pp_betrieb"
#-----------------------------------------------------------
import_ssh_hostkeys() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Importing SSH host keys ..."
#-----------------------------------------------------------
create_etc_hosts() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Generating /etc/hosts ..."
#-----------------------------------------------------------
set_hostname() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Setting hostname ${hostname} ..."
hostnamectl set-hostname --static "${hostname}"
disable_ipv6() {
local sysctl_file="/etc/sysctl.d/99-disable-ipv6.conf"
echo
+ echo "${HASH_LINE}"
+ echo
log "Disabling IPv6 in '${sysctl_file}' ..."
mkdir -pv /etc/sysctl.d
echo "#disable ipv6" | tee -a "${sysctl_file}"
#-----------------------------------------------------------
install_network() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Generating network configuration ..."
#-----------------------------------------------------------
manage_dns() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Generating /etc/resolv.conf ..."
#-----------------------------------------------------------
tweak_systemd() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Tweaking systemd ..."
local grub_cfg="/etc/default/grub"
if [[ -f "${grub_cfg}" ]] ; then
+ echo
+ echo "${HASH_LINE}"
echo
log "Tweaking '${grub_cfg}' ..."
#-----------------------------------------------------------
install_epel() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Install EPEL repository package ..."
#-----------------------------------------------------------
install_pp_tcsh_env() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Pulling pixelpark TCSH config .."
#-----------------------------------------------------------
make_pp_dirs() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Creating Pixelpark directories ..."
for bname in bin etc man ; do
local misc_pkgs="ksh tmux vim telnet curl git"
local misc_pkgs_remove="deltarpm nfs* rpcbind abrt*"
+ echo
+ echo "${HASH_LINE}"
echo "Disabling mysql-community in /etc/yum.conf ..."
echo "exclude=mysql-community*" >> /etc/yum.conf
+ echo
+ echo "${HASH_LINE}"
echo
log "Installing NetworkManager ..."
yum install -y NetworkManager NetworkManager-config-server NetworkManager-tui
#-----------------------------------------------------------
remove_ipv6_localhost() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Removing ::1 from /etc/hosts ..."
#-----------------------------------------------------------
create_motd() {
+ echo
+ echo "${HASH_LINE}"
echo
local url="${COBBLER_URL}/custom/pp-scripts/mk_create_motd.ksh"
local url_client="${COBBLER_URL}/custom/legato/lgtoclnt-latest.x86_64.rpm"
local url_man="${COBBLER_URL}/custom/legato/lgtoman-latest.x86_64.rpm"
+ echo
+ echo "${HASH_LINE}"
echo
log "Installing Legato networker client ..."
#-----------------------------------------------------------
install_ntp() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Deinstalling chrony from whatever reason ..."
echo "Stopping chronyd ..."
#-----------------------------------------------------------
install_openvm_tools() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Installing open-vm-tools ..."
#-----------------------------------------------------------
remove_uek_packages() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Switch kernel in /etc/sysconfig/kernel ..."
#-----------------------------------------------------------
dist_upgrade() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Upgrading all packages ..."
echo
local puppet_conf_file="${puppet_conf_dir}/puppet.conf"
local facter_conf_dir="${pplabs_conf_dir}/facter/facter.d"
+ echo
+ echo "${HASH_LINE}"
echo
log "Installing Puppet agent ..."
echo
#-----------------------------------------------------------
disable_floppy() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Disabling floppy kernel module ..."
#-----------------------------------------------------------
set_root_pw() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Setting root password ..."
usermod -p "${ROOT_PW_CRYPTED}" root
#-----------------------------------------------------------
disable_root_login_pw() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Disabling SSH access for root with password ..."
#-----------------------------------------------------------
install_clamav() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Installing and configuring ClamAV ..."
#-----------------------------------------------------------
install_postfix() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Installing and configuring Postfix ..."
#-----------------------------------------------------------
config_rsyslog_to_remote() {
+ echo
+ echo "${HASH_LINE}"
echo
log "Adding loghost to rsyslog configuration ..."