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
|
2022-05-19 17:31:38 +00:00
|
|
|
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
|
|
|
|
2022-07-14 19:08:13 +00:00
|
|
|
if [ ! -d "${HOME}/src/ansible-desktop" ]; then
|
2022-05-19 17:31:38 +00:00
|
|
|
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
|