From e48ef9126599baabc916791c1f19b1869c8736d3 Mon Sep 17 00:00:00 2001 From: Gilles Mouchet Date: Wed, 22 May 2024 00:15:45 +0200 Subject: [PATCH] add check vault_pass file --- inst-raps.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/inst-raps.sh b/inst-raps.sh index c3321dd..daf49bb 100755 --- a/inst-raps.sh +++ b/inst-raps.sh @@ -137,14 +137,6 @@ chronyc -a makestep if [ $? -ne 0 ]; then printError "Problem to update date and time";exit; fi printSuccess "Date and Time 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";exit; fi -printSuccess "Ansible playbook finished" - #----------------------------------------------------------------------------- # check /root/ansible/.vault_pass.txt exits #----------------------------------------------------------------------------- @@ -155,6 +147,14 @@ if [ ! -f "/root/ansible/.vault_pass.txt"]; then fi printSuccess "/root/ansible/.vault_pass.txt exist" +#----------------------------------------------------------------------------- +# 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";exit; fi +printSuccess "Ansible playbook finished" + #----------------------------------------------------------------------------- # set timezone #-----------------------------------------------------------------------------