updated provision.sh

This commit is contained in:
Paul 2020-04-26 16:41:22 +02:00
parent 4c5b603530
commit 3b3b274ab0

View File

@ -5,6 +5,7 @@ remote_file_url="https://git.paulbsd.com/paulbsd/ansible-gnu-corporate-workstati
tmp_dir="/tmp"
archive_file="/tmp/ansible-gnu-corporate-workstation-master.zip"
working_directory="/tmp/ansible-gnu-corporate-workstation"
playbook_file="playbook.yml"
update()
{
@ -15,13 +16,13 @@ update()
fetch_archive()
{
wget -O ${archive_file} ${remote_file_url}
unzip -o -d /tmp /tmp/master.zip
unzip -o -d ${tmp_dir} ${archive_file}
}
run_playbook()
{
cd ${working_directory}
sudo ansible-playbook -i hosts playbook.yml
sudo ansible-playbook -i hosts ${playbook_file}
cd ${tmp_dir}
}
@ -42,5 +43,5 @@ echo "Let's extract the archive ..."
if [[ -f ${archive_file} ]]
then
echo "Let's go ..."
run_playbook ${working_directory} && cleanup
run_playbook && cleanup
fi