ansible-desktop/install.sh

25 lines
544 B
Bash
Raw Permalink Normal View History

2020-07-01 14:26:49 +00:00
#!/usr/bin/env bash
2021-11-30 23:55:53 +00:00
set -e
SUDO='sudo'
ANSIBLE_REPO='https://git.grondek.pl/pgrondek/ansible-desktop.git'
if [[ "$EUID" == 0 ]]; then
echo "Run script as normal user"
2020-07-01 14:26:49 +00:00
fi
2022-05-19 17:18:29 +00:00
"${SUDO}" apt update
"${SUDO}" apt install software-properties-common
"${SUDO}" apt-add-repository --yes --update ppa:ansible/ansible
"${SUDO}" apt install -y git ansible
2021-11-30 23:55:53 +00:00
if [ ! -d "${HOME}/src/ansible-desktop" ]; then
mkdir -p "${HOME}/src"
cd "${HOME}/src"
git clone "$ANSIBLE_REPO"
fi
cd "${HOME}/src/ansible-desktop"
git pull
2021-11-30 23:55:53 +00:00
ansible-playbook localhost.yml