From be66c44195999aa7597795c223ec12d42d303aa1 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Thu, 31 Aug 2017 21:58:34 +0200 Subject: [PATCH] added auto provision script from web, updated some code --- README.md | 5 +---- hosts | 1 - provision.sh | 20 ++++++++++---------- 3 files changed, 11 insertions(+), 15 deletions(-) delete mode 100644 hosts diff --git a/README.md b/README.md index 4bd4f61..d6fbaaa 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,5 @@ ansible-gnu-corporate-workstation is a set of roles that enable Active Directory ### Installation ``` -todo +wget -O - https://raw.githubusercontent.com/paulbsd/ansible-gnu-corporate-workstation/master/provision.sh | bash ``` - - - diff --git a/hosts b/hosts deleted file mode 100644 index 2a25209..0000000 --- a/hosts +++ /dev/null @@ -1 +0,0 @@ -localhost ansible_user=vagrant ansible_password=vagrant ansible_ssh_port=2222 diff --git a/provision.sh b/provision.sh index bd397e1..d9e99ff 100755 --- a/provision.sh +++ b/provision.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash prereqs="curl wget ansible" -remote_file_url="https://github.com/paulbsd/???" -archive_file="/tmp/???.tar.gz" -working_directory="/tmp/???" +remote_file_url="https://github.com/paulbsd/ansible-gnu-corporate-workstation/archive/master.zip" +archive_file="/tmp/master.zip" +working_directory="/tmp/ansible-gnu-corporate-workstation" update() { - apt-get update - apt-get install -y ${prereqs} + sudo apt-get update + sudo apt-get install -y ${prereqs} } fetch_archive() @@ -19,24 +19,24 @@ fetch_archive() run_playbook() { cd $1 - ansible-playbook playbook.yml + sudo ansible-playbook playbook.yml } cleanup() { - rm -rf /tmp/??? + rm -rf ${archive_file} + rm -rf ${working_directory} } -echo "Let's update repositories and install ansible" +echo "Let's update repositories and install Ansible ..." update echo "Let's download archive ..." fetch_archive - if [[ -f ${archive_file} ]] then - echo "Let's run " + echo "Let's go ... " run_playbook ${working_directory} cleanup fi