#!/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 python-is-python3 elif [[ $(command -v dnf) ]]; then sudo dnf install ansible -y elif [[ $(command -v emerge) ]]; then sudo emerge ansible fi elif [[ $(uname) == "Darwin" ]]; then if [[ ! $(command -v brew) ]]; then # Yeah, raw brew install /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" fi /usr/local/bin/brew install ansible fi ANSIBLE_PYTHON_INTERPRETER="$(which python)" ansible-galaxy install kewlfft.aur ansible-galaxy collection install community.general ansible-playbook --ask-become-pass -i inventory main.yml