From: Frank Brehm Date: Tue, 23 Jan 2024 15:03:14 +0000 (+0100) Subject: Removing user and group 'cloud-user' on postinstall actions X-Git-Tag: 1.8.6^2~3 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=99bee37cce4346dd90491ba56fcbce8670ae3e10;p=pixelpark%2Fcreate-terraform.git Removing user and group 'cloud-user' on postinstall actions --- diff --git a/postinstall-scripts/update-all-packages b/postinstall-scripts/update-all-packages index c5444be..1360617 100755 --- a/postinstall-scripts/update-all-packages +++ b/postinstall-scripts/update-all-packages @@ -198,6 +198,7 @@ ok==1 {print "ip_resolve=4"; ok=0} if rpm -qa | grep --quiet --perl-regexp '^cloud-init-\d' ; then exec_cmd ${tool} --assumeyes erase cloud-init RM -rf /etc/sysconfig/network-scripts/* /etc/sysconfig/network-scripts/.* + sleep 1 fi for logfile in /var/log/cloud-init.log /var/log/cloud-init-output.log ; do @@ -208,6 +209,18 @@ ok==1 {print "ip_resolve=4"; ok=0} RM "${logfile}}" done + if getent passwd cloud-user >/dev/null; then + info "Removing user 'cloud-user' ..." + exec_cmd userdel -r cloud-user + sleep 1 + fi + + if getent group cloud-user >/dev/null; then + info "Removing group 'cloud-user' ..." + exec_cmd groupdel cloud-user + sleep 1 + fi + echo info "Doing upgrade ..." exec_cmd ${tool} --assumeyes upgrade