-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap
More file actions
executable file
·34 lines (29 loc) · 922 Bytes
/
Copy pathbootstrap
File metadata and controls
executable file
·34 lines (29 loc) · 922 Bytes
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
#!/usr/bin/env bash
set -e
if [ ! -d ~/workspace ]; then
mkdir ~/workspace
fi
if which git >/dev/null; then
sudo apt-get install -y git > /dev/null
fi
if [ ! -d ~/workspace/dotfiles ]; then
echo cloning dotfiles repo. remember to update origin after installing ssh keys
pushd ~/workspace
git clone https://github.com/charlesj/dotfiles.git > /dev/null
popd
fi
if which ansible >/dev/null; then
echo skipping ansible installation
else
echo installing ansible
sudo apt-get install -y software-properties-common > /dev/null
sudo apt-add-repository ppa:ansible/ansible -y > /dev/null
sudo apt-get update > /dev/null
sudo apt-get install -y ansible > /dev/null
echo ansible installed
fi
if cat ~/workspace/dotfiles/ansible/inventory.ini | grep $(hostname) > /dev/null; then
echo Ready to provision $(hostname)
else
echo $(hostname) not in inventory. Update inventory then run provision
fi