ansible-desktop/install.sh

25 lines
571 B
Bash
Executable File

#!/usr/bin/env bash
set -e
SUDO='sudo'
ANSIBLE_REPO='https://git.grondek.dev/pgrondek/ansible-desktop.git'
if [[ "$EUID" == 0 ]]; then
echo "Run script as normal user"
fi
"${SUDO}" apt update
"${SUDO}" apt install software-properties-common
"${SUDO}" apt-add-repository --yes --update ppa:ansible/ansible
"${SUDO}" apt install -y git ansible
if [ ! -d "${HOME}/src/desktop/ansible-desktop" ]; then
mkdir -p "${HOME}/src/desktop/"
cd "${HOME}/src/desktop/"
git clone "$ANSIBLE_REPO"
fi
cd "${HOME}/src/ansible-desktop"
git pull
ansible-playbook localhost.yml