fixed bugs
This commit is contained in:
parent
5eeaba3fd2
commit
747ec4d942
16
provision.sh
16
provision.sh
@ -2,8 +2,9 @@
|
||||
|
||||
prereqs="curl wget ansible"
|
||||
remote_file_url="https://github.com/paulbsd/ansible-gnu-corporate-workstation/archive/master.zip"
|
||||
tmp_dir="/tmp"
|
||||
archive_file="/tmp/master.zip"
|
||||
working_directory="/tmp/ansible-gnu-corporate-workstation"
|
||||
working_directory="/tmp/ansible-gnu-corporate-workstation-master"
|
||||
|
||||
update()
|
||||
{
|
||||
@ -14,12 +15,14 @@ update()
|
||||
fetch_archive()
|
||||
{
|
||||
wget -O ${archive_file} ${remote_file_url}
|
||||
unzip -o -d /tmp /tmp/master.zip
|
||||
}
|
||||
|
||||
run_playbook()
|
||||
{
|
||||
cd $1
|
||||
sudo ansible-playbook playbook.yml
|
||||
cd ${working_directory}
|
||||
sudo ansible-playbook -i hosts playbook.yml
|
||||
cd ${tmp_dir}
|
||||
}
|
||||
|
||||
cleanup()
|
||||
@ -34,9 +37,10 @@ update
|
||||
echo "Let's download archive ..."
|
||||
fetch_archive
|
||||
|
||||
echo "Let's extract the archive ..."
|
||||
|
||||
if [[ -f ${archive_file} ]]
|
||||
then
|
||||
echo "Let's go ... "
|
||||
run_playbook ${working_directory}
|
||||
cleanup
|
||||
echo "Let's go ..."
|
||||
run_playbook ${working_directory} && cleanup
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user