From 5d321ed187e3bb60fa5cde03e12e91de4bbe3d1e Mon Sep 17 00:00:00 2001 From: Gilles Mouchet Date: Sat, 29 Jun 2024 15:02:38 +0200 Subject: [PATCH] add updates hosts clone --- inst-raps.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/inst-raps.sh b/inst-raps.sh index f2eeda3..af622b8 100755 --- a/inst-raps.sh +++ b/inst-raps.sh @@ -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" #-----------------------------------------------------------------------------