From: Frank Brehm Date: Wed, 8 Nov 2023 12:50:29 +0000 (+0100) Subject: More cleaning up. X-Git-Tag: 3.2.1~27 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=94213b04aa200d45043226e27ac6d025d65b5c80;p=pixelpark%2Fcreate-vmware-tpl.git More cleaning up. --- diff --git a/etc/cobbler-distros.d/centos-7.yaml b/etc/cobbler-distros.d/centos-7.yaml index 72034d3..f817599 100644 --- a/etc/cobbler-distros.d/centos-7.yaml +++ b/etc/cobbler-distros.d/centos-7.yaml @@ -21,32 +21,20 @@ cobbler-distros: - '@base' - 'bash-completion' - 'bc' - # - 'bind-utils' - 'chrony' - 'curl' - # - 'git' - # - 'iotop' - 'lsof' - # - 'mailx' - 'man' - # - 'mlocate' - 'net-tools' - # - 'postfix' - 'psmisc' - # - 'rsync' - # - 'strace' - # - 'sysstat' - # - 'tcpdump' - # - 'telnet' - 'tmux' - # - 'traceroute' - 'vim' - 'wget' - # - 'yum-utils' - '-iwl*' - '-mysql-community*' - '-nfs*' - '-rpcbind' + - '-sysstat' snippets: - 'tpl.001.basics.sh' - 'tpl.010.authkeys.sh' @@ -54,21 +42,16 @@ cobbler-distros: - 'tpl.060.tweak_systemd.sh' - 'tpl.070.tweak_grub.sh' - 'tpl.074.tmp-tmpfs-el7.sh' - # - 'tpl.080.rsyslogd-el7.sh' - 'tpl.085.disable-ipv6.sh' - 'tpl.100.clear_repos.sh' - 'tpl.170.repos_centos7.sh' - 'tpl.175.repos_el7.sh' - 'tpl.200.init-repos.sh' - # - 'tpl.205.bashrc-el7.sh' - 'tpl.225.vimrc-el7.sh' - 'tpl.250.pkgs-el7.sh' - 'tpl.280.dist-upgrade.sh' - # - 'tpl.300.create-motd.sh' - 'tpl.320.root-ssh-login.sh' - 'tpl.400.chrony.sh' - 'tpl.450.puppet.sh' - # - 'tpl.470.postfix.sh' - # - 'tpl.500.logrotate.sh' - 'tpl.999.finish.sh' diff --git a/etc/cobbler-distros.d/centos-stream-8.yaml b/etc/cobbler-distros.d/centos-stream-8.yaml index 8c7522b..4333408 100644 --- a/etc/cobbler-distros.d/centos-stream-8.yaml +++ b/etc/cobbler-distros.d/centos-stream-8.yaml @@ -25,33 +25,18 @@ cobbler-distros: - 'NetworkManager-config-server' - 'bash-completion' - 'bc' - # - 'bind-utils' - 'chrony' - 'cloud-init' - 'curl' - 'dbus' - # - 'git' - # - 'grubby' - # - 'iotop' - # - 'langpacks-de' - 'lsof' - # - 'mailx' - 'man' - # - 'mlocate' - 'net-tools' - 'oddjob-mkhomedir' - # - 'postfix' - 'psmisc' - # - 'rsync' - # - 'strace' - # - 'sysstat' - # - 'tcpdump' - # - 'telnet' - 'tmux' - # - 'traceroute' - 'vim' - 'wget' - # - 'yum-utils' - '-abrt*' - '-iwl*' - '-nfs*' @@ -63,22 +48,16 @@ cobbler-distros: - 'tpl.060.tweak_systemd.sh' - 'tpl.070.tweak_grub.sh' - 'tpl.075.tmp-tmpfs.sh' - # - 'tpl.080.rsyslogd-el8.sh' - 'tpl.085.disable-ipv6.sh' - 'tpl.100.clear_repos.sh' - 'tpl.180.repos_centos8.sh' - 'tpl.185.repos_el8.sh' - 'tpl.200.init-repos.sh' - # - 'tpl.210.bashrc-el8.sh' - # - 'tpl.220.locales-el8.sh' - 'tpl.230.vimrc-el8.sh' - 'tpl.250.pkgs-el8.sh' - 'tpl.280.dist-upgrade.sh' - # - 'tpl.300.create-motd.sh' - 'tpl.320.root-ssh-login.sh' - 'tpl.400.chrony.sh' - 'tpl.450.puppet.sh' - # - 'tpl.470.postfix.sh' - # - 'tpl.500.logrotate.sh' - 'tpl.999.finish.sh' diff --git a/etc/cobbler-distros.d/oel-7.yaml b/etc/cobbler-distros.d/oel-7.yaml index 3706795..75aea06 100644 --- a/etc/cobbler-distros.d/oel-7.yaml +++ b/etc/cobbler-distros.d/oel-7.yaml @@ -25,32 +25,20 @@ cobbler-distros: - '@base' - 'bash-completion' - 'bc' - # - 'bind-utils' - 'chrony' - 'curl' - # - 'git' - # - 'iotop' - 'lsof' - # - 'mailx' - 'man' - # - 'mlocate' - 'net-tools' - # - 'postfix' - 'psmisc' - # - 'rsync' - # - 'strace' - # - 'sysstat' - # - 'tcpdump' - # - 'telnet' - 'tmux' - # - 'traceroute' - 'vim' - 'wget' - # - 'yum-utils' - '-iwl*' - '-mysql-community*' - '-nfs*' - '-rpcbind' + - '-sysstat' - '-*uek*' snippets: - 'tpl.001.basics.sh' @@ -59,21 +47,16 @@ cobbler-distros: - 'tpl.060.tweak_systemd.sh' - 'tpl.070.tweak_grub.sh' - 'tpl.074.tmp-tmpfs-el7.sh' - # - 'tpl.080.rsyslogd-el7.sh' - 'tpl.085.disable-ipv6.sh' - 'tpl.100.clear_repos.sh' - 'tpl.170.repos_oel7.sh' - 'tpl.175.repos_el7.sh' - 'tpl.200.init-repos.sh' - # - 'tpl.205.bashrc-el7.sh' - 'tpl.225.vimrc-el7.sh' - 'tpl.250.pkgs-el7.sh' - 'tpl.270.remove-uek.sh' - 'tpl.280.dist-upgrade.sh' - # - 'tpl.300.create-motd.sh' - 'tpl.320.root-ssh-login.sh' - 'tpl.400.chrony.sh' - 'tpl.450.puppet.sh' - # - 'tpl.470.postfix.sh' - # - 'tpl.500.logrotate.sh' - 'tpl.999.finish.sh' diff --git a/etc/cobbler-distros.d/rhel-9.yaml b/etc/cobbler-distros.d/rhel-9.yaml index 0afa1b0..b6b86bd 100644 --- a/etc/cobbler-distros.d/rhel-9.yaml +++ b/etc/cobbler-distros.d/rhel-9.yaml @@ -14,39 +14,25 @@ cobbler-distros: - 'NetworkManager-config-server' - 'bash-completion' - 'bc' - # - 'bind-utils' - 'chrony' - 'cloud-init' - 'curl' - 'dbus' - # - 'grubby' - # - 'iotop' - 'kexec-tools' - # - 'langpacks-de' - 'lsof' - 'man' - # - 'mlocate' - 'net-tools' - 'oddjob-mkhomedir' - 'psmisc' - # - 'rsync' - # - 's-nail' - # - 'strace' - # - 'sysstat' - # - 'tcpdump' - # - 'telnet' - 'tmux' - # - 'traceroute' - 'vim' - 'wget' - # - 'yum-utils' - '-abrt*' - '-iwl*' - '-nfs*' - '-rpcbind' snippets: - 'tpl.001.basics.sh' - # - 'tpl.005.update_resolvconf.sh' - 'tpl.010.authkeys.sh' - 'tpl.041.network-el9.sh' # tweak_systemd will be removed, when the appropriate Puppet profile is working @@ -54,21 +40,15 @@ cobbler-distros: - 'tpl.070.tweak_grub.sh' # 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.100.clear_repos.sh' - 'tpl.110.register-rhel.sh' - 'tpl.190.repos_rhel9.sh' - 'tpl.195.repos_el9.sh' - 'tpl.200.init-repos.sh' - # - 'tpl.211.bashrc-el9.sh' - # - 'tpl.221.locales-el9.sh' - 'tpl.231.vimrc-centos9.sh' - # - 'tpl.250.pkgs-el9.sh' - 'tpl.280.dist-upgrade.sh' - # - 'tpl.300.create-motd.sh' - 'tpl.320.root-ssh-login.sh' - 'tpl.400.chrony.sh' - 'tpl.450.puppet.sh' - # - 'tpl.500.logrotate.sh' - 'tpl.999.finish.sh' diff --git a/lib/cr_vmware_tpl/handler/vm.py b/lib/cr_vmware_tpl/handler/vm.py index 8d5737c..3421b6f 100644 --- a/lib/cr_vmware_tpl/handler/vm.py +++ b/lib/cr_vmware_tpl/handler/vm.py @@ -292,6 +292,7 @@ class HandlerVmMixin(): '/var/log/cloud-init-output.log', '/var/log/cron', '/var/log/dnf*.log', + '/var/log/grubby*', '/var/log/hawkey.log', '/var/log/messages', '/var/log/secure', @@ -350,7 +351,8 @@ class HandlerVmMixin(): echo echo "-----------------------------------------------------------" echo "Clearing journal log ..." - journalctl --rotate --vacuum-time=2s + journalctl --flush + journalctl -m --vacuum-time=1s echo echo "-----------------------------------------------------------" @@ -438,14 +440,19 @@ class HandlerVmMixin(): echo echo "-----------------------------------------------------------" echo "Clearing journal log ..." - journalctl --rotate --vacuum-time=2s + journalctl --flush + systemctl stop systemd-journald.socket + systemctl stop systemd-journald.service + rm -rfv /var/log/journal/* echo echo "-----------------------------------------------------------" echo "Truncating /var/log/*tmp and /var/log/messages ..." + systemctl stop rsyslog.service cp -v /dev/null /var/log/btmp cp -v /dev/null /var/log/wtmp cp -v /dev/null /var/log/messages + cp -v /dev/null /var/log/dmesg echo echo "Sleeping some seconds ..."