#!/usr/bin/env bash set -ex PATH="$PATH:$HOME/.local/bin" if [[ $(command -v ansible) ]]; then printf "ansible already installed\n" elif [[ $(uname) == "Linux" ]]; then if [[ $(command -v pacman) ]]; then sudo pacman -Sy --noconfirm ansible elif [[ $(command -v zypper) ]]; then sudo zypper install -y ansible sudo ln -sf /usr/bin/python3 /usr/bin/python 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 -sf /usr/bin/python3 /usr/bin/python elif [[ $(command -v dnf) ]]; then sudo dnf install ansible -y fi elif [[ $(uname) == "Darwin" && ! $(command -v brew) ]]; then # Yeah, raw brew install /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /usr/local/bin/brew install ansible fi ANSIBLE_PYTHON_INTERPRETER="$(which python)" ansible-galaxy install kewlfft.aur ansible-playbook --ask-become-pass -i inventory main.yml