From 20be098dfde401f41aa272dcce3fb77976086ba4 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 1 Nov 2023 17:51:32 +0100 Subject: [PATCH] Fixing some snippets, package lists and post actions. --- etc/cobbler-distros.d/rhel-9.yaml | 4 ++-- lib/cr_vmware_tpl/handler/vm.py | 10 ++++++++ snippets/tpl.075.tmp-tmpfs.sh | 38 ++++++++----------------------- snippets/tpl.110.register-rhel.sh | 5 ++++ snippets/tpl.450.puppet.sh | 3 +++ 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/etc/cobbler-distros.d/rhel-9.yaml b/etc/cobbler-distros.d/rhel-9.yaml index 7ee569c..0afa1b0 100644 --- a/etc/cobbler-distros.d/rhel-9.yaml +++ b/etc/cobbler-distros.d/rhel-9.yaml @@ -38,7 +38,7 @@ cobbler-distros: - 'tmux' # - 'traceroute' - 'vim' - # - 'wget' + - 'wget' # - 'yum-utils' - '-abrt*' - '-iwl*' @@ -55,7 +55,7 @@ cobbler-distros: # tmp-tmpfs will be removed, when the appropriate Puppet profile is working - 'tpl.075.tmp-tmpfs.sh' # - 'tpl.080.rsyslogd-el9.sh' - # - 'tpl.085.disable-ipv6.sh' + - 'tpl.085.disable-ipv6.sh' - 'tpl.100.clear_repos.sh' - 'tpl.110.register-rhel.sh' - 'tpl.190.repos_rhel9.sh' diff --git a/lib/cr_vmware_tpl/handler/vm.py b/lib/cr_vmware_tpl/handler/vm.py index b74c62d..ba8e0b4 100644 --- a/lib/cr_vmware_tpl/handler/vm.py +++ b/lib/cr_vmware_tpl/handler/vm.py @@ -302,6 +302,16 @@ class HandlerVmMixin(): printf "Current host FQDN: " hostname -f + echo + echo "All installed packages:" + echo "-----------------------" + rpm -qa | sort + + echo + echo "All filesystems:" + echo "----------------" + df -m -a -T + for ks_cfg in "/root/original-ks.cfg" "/root/anaconda-ks.cfg" ; do echo echo "-----------------------------------------------------------" diff --git a/snippets/tpl.075.tmp-tmpfs.sh b/snippets/tpl.075.tmp-tmpfs.sh index ba39704..f0d54e2 100644 --- a/snippets/tpl.075.tmp-tmpfs.sh +++ b/snippets/tpl.075.tmp-tmpfs.sh @@ -4,37 +4,19 @@ #----------------------------------------------------------- setup_tmp_tmpfs() { - echo -e "\e[0Ksection_start:$( date +%s ):ks_setup_tmp_tmpfs[collapsed=true]\r\e[0KSetting up /tmp as a tmpfs ..." + local fstab="/etc/fstab" + if [[ -f "${fstab}" ]] ; then - local unit_file="/etc/systemd/system/tmp.mount" - echo - echo "Creating a systemd unit file '${unit_file}' providing a temp filesystem below /tmp" + echo -e "\e[0Ksection_start:$( date +%s ):ks_setup_tmp_tmpfs[collapsed=true]\r\e[0KSetting up /tmp as a tmpfs ..." + echo + echo "${HASH_LINE}" + echo + log "Setting up /tmp as a tmpfs in '${fstab}' ..." - cat > "${unit_file}" <<-EOF - # Unit file for creating a temp filesystem below /tmp + echo 'tmpfs /tmp tmpfs nosuid,size=10% 0 0' >>"${fstab}" - [Unit] - Description=Creating a temporary filesystem below /tmp - Before=local-fs.target - - [Install] - WantedBy=local-fs.target - - [Mount] - What=tmpfs - Where=/tmp - Type=tmpfs - Options=nosuid,size=10%% - - EOF - - echo - echo "Content of '${unit_file}':" - echo "---------- snip ----------" - cat "${unit_file}" - echo "---------- snip ----------" - - echo -e "\e[0Ksection_end:$( date +%s ):ks_setup_tmp_tmpfs\r\e[0K" + echo -e "\e[0Ksection_end:$( date +%s ):ks_setup_tmp_tmpfs\r\e[0K" + fi } setup_tmp_tmpfs diff --git a/snippets/tpl.110.register-rhel.sh b/snippets/tpl.110.register-rhel.sh index 77ea16d..2a18e1b 100644 --- a/snippets/tpl.110.register-rhel.sh +++ b/snippets/tpl.110.register-rhel.sh @@ -20,6 +20,8 @@ register_rhel() { err_msg="Either RHSM_USER or RHSM_PWD are not defined as meta variables." else if [[ -x "${rhsm}" ]] ; then + echo + echo "Executing: ${cmd}" if [[ -n "${rhsm_system_id}" ]] ; then if eval ${cmd} --consumerid "${rhsm_system_id}" ; then rhsm_registred='y' @@ -41,9 +43,12 @@ register_rhel() { log "System '${fqdn}' successful registred at RedHat Subscription Management." echo echo "Subscription Management Idendity:" + echo "Executing: ${rhsm} identity" ${rhsm} identity echo + echo "Executing: ${rhsm} list --consumed" ${rhsm} list --consumed + echo else log "Could not register system '$( hostname -f )' at RedHat Subscription Management: ${err_msg}" fi diff --git a/snippets/tpl.450.puppet.sh b/snippets/tpl.450.puppet.sh index e512db1..223847a 100644 --- a/snippets/tpl.450.puppet.sh +++ b/snippets/tpl.450.puppet.sh @@ -17,6 +17,7 @@ install_puppet() { echo echo "Creating group puppet ..." groupadd --system puppet + printf "Group entry: " getent group puppet echo @@ -26,7 +27,9 @@ install_puppet() { --comment "Puppet configuration management" \ --shell /sbin/nologin \ puppet + printf "User entry: " getent passwd puppet + printf "User Id: " id puppet echo -- 2.39.5