add clean up

This commit is contained in:
Gilles Mouchet 2024-06-22 11:12:17 +02:00
parent e13b8c9a48
commit b1a33ebbec
3 changed files with 12 additions and 10 deletions

View File

@ -34,17 +34,17 @@ alias sudo='sudo --preserve-env=PATH env' # https://www.petefreitag.com/blog/env
if ! is_scp; then
if [[ "$USER" == "gilles" || "$USER" == "root" ]]; then
host_fqdn=$(hostname)
host_shot=$(hostname -s)
host_short=$(hostname -s)
ip=$(hostname -I)
dist=$(cat /etc/redhat-release)
kern=$(uname -r)
cat << EOF
-----------------------------------------------------
---------------------------------------------------------
Host name (fqdn): $host_fqdn
Host name (short): $host_short
Distribution: $dist
Kernel: $kern
-----------------------------------------------------
----------------------------------------------------------
EOF
fi
fi

View File

@ -168,9 +168,17 @@ printSuccess "Role updated successfully"
#-----------------------------------------------------------------------------
printInfo "Execute playbook"
~/.local/bin/ansible-playbook main.yml --vault-password-file ~/ansible/.vault_pass.txt
if [ $? -ne 0 ]; then printError "Problem to execute playbook";exit; fi
if [ $? -ne 0 ]; then printError "Problem to execute playbook" fi
printSuccess "Ansible playbook finished"
#-----------------------------------------------------------------------------
# Clean upset timezone
#-----------------------------------------------------------------------------
printInfo "CleanUp"
rm -rf /tmp/yumupd
if [ $? -ne 0 ]; then printError "Problem to cleanUP";exit; fi
printSuccess "successfully"
#-----------------------------------------------------------------------------
# set timezone
#-----------------------------------------------------------------------------

View File

@ -10,9 +10,3 @@
src: /usr/local/bin/check-yum-updates.sh
dest: /etc/cron.daily/check-yum-updates.sh
state: link
- name: delete source
file:
path: /tmp/yumupd
state: absent