-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·42 lines (36 loc) · 1.03 KB
/
setup
File metadata and controls
executable file
·42 lines (36 loc) · 1.03 KB
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
#!/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 && test ! "$(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 --ask-become-pass
# test -d ~/.dotfiles && cd $_ && ./script/bootstrap