dotfiles/playbook/launch
2019-07-30 20:13:17 -04:00

23 lines
770 B
Bash
Executable file

#!/usr/bin/env bash
set -ex
PATH="$PATH:$HOME/.local/bin"
if [[ $(command -v ansible) ]]; then
printf "ansible already installed"
elif [[ $(uname) == "Linux" ]]; then
if [[ $(command -v pacman) ]]; then
sudo pacman -Sy ansible
elif [[ $(command -v apt) ]]; then
sudo apt install -y ansible python3-apt
# ubuntu doesn't create a /usr/bin/python, so we have to make one ourselves
ln -s /usr/bin/python3 /usr/bin/python
elif [[ $(command -v dnf) ]]; then
sudo dnf install ansible -y
fi
elif [[ $(uname) == "Darwin" ]]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
/usr/local/bin/brew install ansible
fi
ansible-playbook -i inventory main.yml