added auto provision script from web, updated some code
This commit is contained in:
parent
29672d6c3e
commit
be66c44195
@ -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
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
1
hosts
1
hosts
@ -1 +0,0 @@
|
||||
localhost ansible_user=vagrant ansible_password=vagrant ansible_ssh_port=2222
|
20
provision.sh
20
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
|
||||
|
Loading…
Reference in New Issue
Block a user