add updates hosts clone

This commit is contained in:
Gilles Mouchet 2024-06-29 15:02:38 +02:00
parent c871e1d3c8
commit 5d321ed187

View File

@ -155,6 +155,14 @@ git clone https://gitweb.dyndns.org/scripts/yum-check.git /tmp/yumupd
if [ $? -ne 0 ]; then printError "Problem to clone yum-check-update script";exit; fi
printSuccess "yum-check-update script cloned successfully"
#-----------------------------------------------------------------------------
# get update-hosts script
#-----------------------------------------------------------------------------
printInfo "Get update-hosts script"
git clone https://gitweb.dyndns.org/scripts/gest-hosts-file.git /tmp/hostsupd
if [ $? -ne 0 ]; then printError "Problem to clone update-hosts script";exit; fi
printSuccess "update-hosts script cloned successfully"
#-----------------------------------------------------------------------------
# update role
#-----------------------------------------------------------------------------
@ -166,17 +174,20 @@ printSuccess "Role updated successfully"
#-----------------------------------------------------------------------------
# execute playbook
#-----------------------------------------------------------------------------
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"; fi
printSuccess "Ansible playbook finished"
#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"; fi
#printSuccess "Ansible playbook finished"
#-----------------------------------------------------------------------------
# Clean upset timezone
#-----------------------------------------------------------------------------
printInfo "CleanUp"
rm -rf /tmp/yumupd
if [ $? -ne 0 ]; then printError "Problem to cleanUP";exit; fi
rerror=$?
rm -rf /tmp/hostsupd
let "$rerror=$rerror+$?"
if [ $rerror -ne 0 ]; then printError "Problem to cleanUP";exit; fi
printSuccess "CleanUp successfully"
#-----------------------------------------------------------------------------