#######################
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCpHkhAXqfHPrDPCZf1M8CxNz/6o7x3feNst5MRIQ04v4K7va35rdqIoXvskxdjAu2H/z/3qNKJg5y9oBxPEdVroST+ADibnGFaIfETYkQxNHTCGPI/HX0oxkGkIUb04Elojmswmrq/YlEYIDVGD+K2v4zkVmrOiPIyXNIKuVUC1lGBIIhR1DoUB36ejpICf5HY4+EiCO8mIFniUP/jnilHq/ZGYd+JfcD3//JxXFPEk6bMLr2jxBm3LM8FNdDH1uKcPUdrf0fkAS+Kb74s4obSyKamX6mDvvUZmuVaQsNNiZL1iCI3SNx2YxM5P/xv9Pk7E0lu3MTnOX2n/fIW/Rj/nckHr+hmlA1gGuJUGw/9BbR9KmlR8+yIN6Fl3euD2Yto0j4E94elnnxk0FqEgN8wP+Nhcmsjxt2V1a00hivqNF1FZgfb5ZhrA5Rq1BM91yDXzHL1he0jZfOBLt3RsJueAKdIJKv4DR7Zkx9bmJwHJFnE18asIaZNgdW3y7wN4acwHqCdUUKUQ0wurGURZKCdRDzxwOfEQI9HnnTa+q6/XXcRp/REKyRQ8ZTwoAqnmva7unXqwuvZwZM8B+hSPXkGF7lkh5U/mMXJu45WcxV3IBWP4VBYEbh4hAU/9MjMv7EYcjpjvgdrcWQbqiCgw0P9rKopSeCph98CzU5izvVjSQ== Vasko Mihaylov <vasko.mihaylov@pixelpark.com>
#######################
-ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC1h6cZc9uhuw4/B8e06ARMyJF/37ESRG3jJSIMUfdJpVTN0ZTNTvUnqov+s0TYglSvMQ8nPAp3qc7UDIiyaFyoiOZtE0jGZOQwVhWWZF39vfxfAI9EI8yDo01ek4hnlm2vxsx5bzrtgQWocW1WVCJ9z20W9/iVhRrNuBGUg5KoKxr/beQ73O7l9Z8zElwWm6k+PTJjN9C9D+j3FGTjeLPHvELFZiCMuVvhEPuiZABrq7x5HDt67zF38au7ZWu8sYOaJ1zGZNVVVT4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5x/VtDhYMX2bQ+sJZa+XLgPO4CU+B6K1cROu/3gnTb9sTmfhrBRqXIgCVetl+xdJU3kIMSegNC7dT2WJ8B0B6qSkOU3IBQ9ene4/s7RmqJttw2hTCYz9VnokV3Dk7BEaCfcaucSDBZyqN5h6PUmWpttdFWxosJhlFZBeHzFOcCBbMuBaUvr9DNJQ3e5S8C1fUcrE1KkyZaTUjsiHUz9++8gLUp5+vmqX8AwW1+yAJtzz1Et/cKi2LNz4Ph1duryckTFNGcRiWRzC/0qI4DW9y20G8+KLqeRynA6xrmzh0lHZM4htyO4ouTmIyunFOQ39U= Andon Zhuglov <andon.zhuglov@pixelpark.com>
logvol /var --vgname=vgroot --name=var --fstype=xfs --size=4096 --grow
logvol /var/log --vgname=vgroot --name=log --fstype=xfs --size=2048
-##########################################
-# Repositories
-
-repo --name=baseos --install --noverifyssl --baseurl=https://test-cobbler01.pixelpark.com/cobbler/distro_mirror/RHEL-9.2/BaseOS
-repo --name=appstream --install --noverifyssl --baseurl=https://test-cobbler01.pixelpark.com/cobbler/distro_mirror/RHEL-9.2/AppStream
-repo --name=pixelpark --install --noverifyssl --baseurl=https://repo02.pixelpark.com/Linux/yum/pixelpark/9/
-repo --name=puppet --install --noverifyssl --baseurl=https://repo02.pixelpark.com/Linux/yum/puppetlabs/puppet7/el/8/x86_64
-
##########################################
# Packages
%pre --interpreter=/bin/bash --log=/var/log/ks-pre.log
#raw
echo "[$( date --rfc-3339=seconds )]: Hier get's los ..."
+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.11, 93.188.109.12 and 93.188.109.13 to /etc/resolv.conf ..."
+ echo "nameserver 93.188.109.11" >>/etc/resolv.conf
+ echo "nameserver 93.188.109.12" >>/etc/resolv.conf
+ echo "nameserver 93.188.109.13" >>/etc/resolv.conf
+fi
+
+echo
+echo "Used /etc/resolv.conf:"
+cat /etc/resolv.conf
+
#end raw
%end
echo "Using snippet $this_snippet"
$SNIPPET($this_snippet)
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.005.update_resolvconf.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.010.authkeys.sh"
echo
echo "Using snippet $this_snippet"
echo "Using snippet $this_snippet"
$SNIPPET($this_snippet)
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.080.rsyslogd-el8.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.085.disable-ipv6.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.100.clear_repos.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.195.repos_el9.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.211.bashrc-el9.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.220.locales-el9.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
+#set $this_snippet= "per_status/" + $SYSTEM_STATUS + "/tpl.320.root-ssh-login.sh"
+echo
+echo "Using snippet $this_snippet"
+$SNIPPET($this_snippet)
+
# ###########################
# Seems to be finished
ERROR_POINTER="/root/postinst-error.txt"
+declare -a NAMESERVERS=()
+declare -a NS_SEARCH_DOMAINS=()
+#end raw
+
+#for $ns in $name_servers
+NAMESERVERS+=( "$ns" )
+#end for
+
+#for $domain in $name_servers_search
+NS_SEARCH_DOMAINS+=( "$domain" )
+#end for
+
+#raw
echo
echo "Some information:"
echo " \$hostname: $hostname"
echo " \$SIMPLE_HOSTNAME: $SIMPLE_HOSTNAME"
echo " \$DOMAIN: $DOMAIN"
echo " \$cobbler_url: $cobbler_url"
+echo " \$NAMESERVERS:"
+for ns in "${NAMESERVERS[@]}" ; do
+ echo " * '${ns}'"
+done
+echo " \$NS_SEARCH_DOMAINS:"
+for domain in "${NS_SEARCH_DOMAINS[@]}" ; do
+ echo " * '${domain}'"
+done
#-----------------------------------------------------------
log() {
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+update_resolv_conf() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_update_resolvconf[collapsed=true]\r\e[0KUpdating /etc/resolv.conf ..."
+ echo
+ echo "${HASH_LINE}"
+ echo
+ log "Updating /etc/resolv.conf ..."
+
+ if grep '^nameserver' /etc/resolv.conf >/dev/null ; then
+ echo "Nameservers are already defined in /etc/resolv.conf."
+ else
+ for ns in "${NAMESERVERS[@]}" ; do
+ echo "nameserver ${ns}" >>/etc/resolv.conf
+ done
+ fi
+
+ if grep '^search' /etc/resolv.conf >/dev/null ; then
+ echo "Search domains are already defined in /etc/resolv.conf."
+ else
+ echo "search ${NS_SEARCH_DOMAINS[*]}" >>/etc/resolv.conf
+ fi
+
+ if grep '^options' /etc/resolv.conf >/dev/null ; then
+ echo "Removing existing options in /etc/resolv.conf ..."
+ grep -v '^options' /etc/resolv.conf >/etc/resolv.conf.new
+ mv -v /etc/resolv.conf.new /etc/resolv.conf
+ fi
+ echo "Setting options in /etc/resolv.conf ..."
+ echo 'options timeout:1 attempts:1' >>/etc/resolv.conf
+
+ echo
+ echo "Using /etc/resolv.conf:"
+ echo "----"
+ cat /etc/resolv.conf
+ echo "----"
+ echo
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_update_resolvconf\r\e[0K"
+}
+
+update_resolv_conf
+
+#end raw
+## vim: ts=4 et list
local tmp_nw_cfg="${temp_dir}/network"
local tmp_nw_script_dir="${temp_dir}/network-scripts"
local nw_script_dir="/etc/sysconfig/network-scripts"
- local old_dir="${nw_script_dir}/.old"
+ local nw_old_dir="${nw_script_dir}/.old"
+ local nm_cfg_dir='/etc/NetworkManager/system-connections'
+ local nm_old_dir="${nm_cfg_dir}/.old"
local ifcfg_file=
local if_uuid=$( uuidgen -r )
mkdir -pv "${tmp_nw_script_dir}"
- mkdir -pv "${old_dir}"
+ mkdir -pv "${nw_old_dir}"
+ mkdir -pv "${nm_old_dir}"
echo "Generating /etc/sysconfig/network ..."
cat '/etc/hosts' | true
echo
- local dev_file="${tmp_nw_script_dir}/ifcfg-${mgmt_interface}"
+ for ifcfg_file in ${nw_script_dir}/ifcfg-* ; do
+ if [[ ! -f "${ifcfg_file}" ]] ; then
+ continue
+ fi
+ local bname=$(basename "${ifcfg_file}" )
+ if [[ "${bname}" == "ifcfg-lo" ]] ; then
+ continue
+ fi
+ mv -v "${ifcfg_file}" "${nw_old_dir}"
+ done
+
+ for ifcfg_file in ${nm_cfg_dir}/*.nmconnection ; do
+ if [[ ! -f "${ifcfg_file}" ]] ; then
+ continue
+ fi
+ local bname=$( basename "${ifcfg_file}" .nmconnection )
+ if [[ "${bname}" == "lo" ]] ; then
+ continue
+ fi
+ mv -v "${ifcfg_file}" "${nm_old_dir}"
+ done
+
+ local dev_basename="${mgmt_interface}.nmconnection"
+ local dev_file="${tmp_nw_script_dir}/${dev_basename}"
echo "Generating '${dev_file}' ..."
cat <<-EOF >"${dev_file}"
- NAME="${mgmt_interface}"
- DEVICE="${mgmt_interface}"
- ONBOOT=yes
- NETBOOT=yes
- UUID="${if_uuid}"
- IPV6INIT=yes
- BOOTPROTO=none
- TYPE=Ethernet
- USERCTL=no
- IPADDR=${IP_ADDRESS_ETH0}
- NETMASK=${NETMASK_ETH0}
- PREFIX=${NETMASK_INT_ETH0}
- IPV4_FAILURE_FATAL=no
- PEERDNS=no
+ [connection]
+ id=${mgmt_interface}
+ uuid=${if_uuid}
+ type=ethernet
+ interface-name=${mgmt_interface}
+
+ [ethernet]
+
+ [ipv4]
+ method=manual
+ address1=${IP_ADDRESS_ETH0}/${NETMASK_INT_ETH0},${gateway}
EOF
local i=1
+ local nameservers=
+ local searchdomains=
local ns=
+ local domain=
- for ns in $( cat /etc/resolv.conf | grep '^nameserver' | awk '{print $2}' ) ; do
- echo "DNS${i}=${ns}" >>"${dev_file}"
- i=$(( $i + 1 ))
- done
+ if [[ "${#NAMESERVERS[*]}" -gt 0 ]] ; then
+ for ns in "${NAMESERVERS[@]}" ; do
+ nameservers+="${ns};"
+ done
+ echo "dns=${nameservers}" >>"${dev_file}"
+ fi
- if grep '^search' /etc/resolv.conf >/dev/null ; then
- local search=$( grep '^search' /etc/resolv.conf | sed -e 's/^search[ ][ ]*//' )
- echo "DOMAIN=\"${search}\"" >>"${dev_file}"
+ if [[ "${#NS_SEARCH_DOMAINS[*]}" -gt 0 ]] ; then
+ for domain in "${NS_SEARCH_DOMAINS[@]}" ; do
+ searchdomains+="${domain};"
+ done
+ echo "dns-search=${searchdomains}" >>"${dev_file}"
fi
- echo "RES_OPTIONS=\"timeout:1 attempts:2\"" >>"${dev_file}"
- echo >>"${dev_file}"
+ cat <<-EOF >>"${dev_file}"
+ dns-options=timeout:1,attempts:2
+
+ [ipv6]
+ addr-gen-mode=eui64
+ method=auto
+
+ [proxy]
+
+ EOF
+
+ chmod -v 0600 "${dev_file}"
+ mv -v "${dev_file}" "${nm_cfg_dir}"
- for ifcfg_file in ${nw_script_dir}/ifcfg-* ; do
- local bname=$(basename "${ifcfg_file}" )
- if [[ "${bname}" == "ifcfg-lo" ]] ; then
- continue
- fi
- mv -v "${ifcfg_file}" "${old_dir}"
- done
- mv -v "${dev_file}" "${nw_script_dir}"
rm -vrf "${temp_dir}"
- echo "Generated ${nw_script_dir}/ifcfg-${mgmt_interface}:"
- cat "${nw_script_dir}/ifcfg-${mgmt_interface}" || true
+ echo "Generated NM configfile '${nm_cfg_dir}/${dev_basename}'"
+ cat "${nm_cfg_dir}/${dev_basename}" || true
echo
echo
echo "${HASH_LINE}"
- echo "Inhalt von /etc/sysconfig/network-scripts ..."
- ls -lA /etc/sysconfig/network-scripts
+ echo "Content of ${nm_cfg_dir} ..."
+ ls -lA "${nm_cfg_dir}"
echo -e "\e[0Ksection_end:$( date +%s ):ks_create_networkconfig\r\e[0K"
}
echo
echo "${HASH_LINE}"
echo
- log "Cleaning all exiting repo files ..."
+ log "Cleaning all existing repo files ..."
local repo_dir="/etc/yum.repos.d"
local old_dir="${repo_dir}/.old"
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+set_locales_centos8() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_set_locales_centos8[collapsed=true]\r\e[0KInstalling german locales ..."
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling set_locales_centos8() ..."
+ echo
+
+ log "Installing german locales (langpacks-de) ..."
+ if yum install -y "langpacks-de" ; then
+ :
+ else
+ echo "[$(date)]: Could not install german locales (langpacks-de)" | tee -a "${ERROR_POINTER}"
+ fi
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_set_locales_centos8\r\e[0K"
+}
+
+set_locales_centos8
+
+#end raw
+## vim: ts=4 et list
--- /dev/null
+## !/bin/bash
+#raw
+
+#-----------------------------------------------------------
+install_pkgs_el7() {
+
+ echo -e "\e[0Ksection_start:$( date +%s ):ks_install_pkgs_el7[collapsed=true]\r\e[0KInstalling additional packages ..."
+ echo
+ echo "${HASH_LINE}"
+ echo "Calling install_pkgs_el7() ..."
+ echo
+ echo
+ log "Installing additional packages ..."
+ echo
+
+ local -a pkgs_add=('colordiff' 'p7zip' 'screen')
+ local -a pkgs_remove=('nfs*' 'rpcbind')
+
+ echo "Installing packages: ${pkgs_add[*]}"
+ yum install -y "${pkgs_add[@]}"
+
+ echo
+ echo "Removing packages: ${pkgs_remove[*]}"
+ yum remove -y "${pkgs_remove[@]}"
+
+ echo
+ echo "Creating /etc/gitconfig ..."
+ cat <<-EOF >/etc/gitconfig
+ [color]
+ ui = true
+ EOF
+
+ echo -e "\e[0Ksection_end:$( date +%s ):ks_install_pkgs_el7\r\e[0K"
+}
+
+install_pkgs_el7
+
+#end raw
+## vim: ts=4 et list