-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·48 lines (39 loc) · 1.07 KB
/
install.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
48
#!/usr/bin/env bash
set -e
function install_homebrew() {
if ! command -v brew > /dev/null 2>&1; then
echo "[+] homebrew could not be found"
echo "[+] Installing homebrew ..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "[+] homebrew already exists!"
fi
}
function install_pipx() {
if ! command -v pipx > /dev/null 2>&1; then
echo "[+] pipx could not be found"
echo "[+] Installing pipx ..."
brew install pipx
pipx ensurepath
source ~/.bashrc
else
echo "[+] pipx already exists!"
fi
}
function install_ansible_and_deps() {
echo "[+] Install ansible and deps"
pipx install --include-deps ansible
echo "[+] Install ansible-galaxy requirements"
ansible-galaxy install -r requirements.yaml
}
function run_bootstrap_playbook() {
echo "[+] Run bootstrap playbook"
./bootstrap.yaml
}
function main() {
install_homebrew
install_pipx
install_ansible_and_deps
run_bootstrap_playbook
}
main