forked from cs-jonathan-beber/machine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup
executable file
·38 lines (36 loc) · 1 KB
/
setup
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
#!/bin/bash
if test "$(uname)" = "Darwin"; then
if test ! $(which gcc); then
echo "Installing xcode..."
xcode-select --install
fi
if test ! $(which brew); then
echo "Installing homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
if test ! $(which ansible); then
echo "Installing ansible..."
brew install ansible
else
brew upgrade ansible
fi
elif test "$(uname)" = "Linux"; then
if test -f /etc/lsb-release -a ! $(which ansible); then
echo "Installing ansible..."
sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible
fi
printf '\n%s\n%s\n' '[privilege_escalation]' 'become = True' >> ansible.cfg
fi
if test ! $(which ansible); then
echo "Not supported yet."
exit 1
fi
python --version
ansible --version
ansible-playbook main.yml
test -d ~/.dotfiles && cd $_ && ./script/bootstrap