diff --git a/install.sh b/install.sh index cb711bd..d42715a 100755 --- a/install.sh +++ b/install.sh @@ -1,12 +1,21 @@ #!/usr/bin/env bash -if [[ "$EUID" -ne 0 ]]; then - echo "You need to be root" - sudo $0 $@ - exit +set -e + +SUDO='sudo' +ANSIBLE_REPO='https://git.grondek.pl/pgrondek/ansible-desktop.git' + +if [[ "$EUID" == 0 ]]; then + echo "Run script as normal user" fi -apt update -apt install software-properties-common -apt-add-repository --yes --update ppa:ansible/ansible -apt install -y git ansible +$(SUDO) apt update +$(SUDO) apt install software-properties-common +$(SUDO) apt-add-repository --yes --update ppa:ansible/ansible +$(SUDO) apt install -y git ansible + +mkdir -p $(HOME)/src +cd $(HOME)/src +git clone "$ANSIBLE_REPO" +cd ansible-desktop +ansible-playbook localhost.yml