forked from bketelsen/workstation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.deploy.test.sh
executable file
·47 lines (35 loc) · 1.03 KB
/
local.deploy.test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
ANSIBLE=$(which ansible-playbook)
GIT=$(which git)
MYLOCBASE="$HOME/tmp"
MYREPO="$MYLOCBASE/bashfulrobot-ansible"
MYREPORMT="https://github.com/bashfulrobot/bashfulrobot-ansible.git"
MYPPA="ansible"
$GIT config user.name bashfulrobot
$GIT config user.email dustin@bashfulrobot.com
$GIT config user.editor micro
if [ ! -f "$ANSIBLE" ]; then
echo "Ansible not found; beginning install..."
echo
# Bootstrap Ansible
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install git ansible -y
fi
if [ ! -f $HOME/.ansible.cfg ]; then
touch $HOME/.ansible.cfg
echo '[defaults]' > $HOME/.ansible.cfg
echo 'remote_tmp = /tmp/$USER/ansible' >> $HOME/.ansible.cfg
fi
# Get the repo
if [ ! -f $MYREPO/local-test.yml ]; then
mkdir -p $MYLOCBASE
cd $MYLOCBASE
$GIT clone $MYREPORMT
fi
cd $MYREPO
# Get the latest version.
$GIT pull
# Run ansible-pull no matter what (local dev iteration)
sudo $ANSIBLE $MYREPO/local-test.yml --connection=local
#sudo rm -rf $HOME/.ansible/