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
|
|
|
|
2023-08-08 21:09:36 +00:00
|
|
|
if [ ! -d "${HOME}/src/desktop/ansible-desktop" ]; then
|
|
|
|
mkdir -p "${HOME}/src/desktop/"
|
|
|
|
cd "${HOME}/src/desktop/"
|
2022-05-19 17:31:38 +00:00
|
|
|
git clone "$ANSIBLE_REPO"
|
|
|
|
fi
|
|
|
|
cd "${HOME}/src/ansible-desktop"
|
|
|
|
git pull
|
2021-11-30 23:55:53 +00:00
|
|
|
ansible-playbook localhost.yml
|