From 646f25a30a96bcf4f2af731f933ff2e6f6511df2 Mon Sep 17 00:00:00 2001 From: aminnairi <18418459+aminnairi@users.noreply.github.com> Date: Sat, 30 Dec 2023 18:48:45 +0100 Subject: [PATCH] the script now requires to be run as root --- main.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.sh b/main.sh index 82b5029..0e115b4 100755 --- a/main.sh +++ b/main.sh @@ -1,8 +1,8 @@ #!/bin/env bash -if [[ "$(id -u)" -eq 0 ]] +if [[ "$(id -u)" -ne 0 ]] then - echo "Please, use an unprivileged user with sudo permissions instead of the root user to run this script properly." + echo "Please, run this script as root" exit 1 fi @@ -58,6 +58,6 @@ ANSIBLE_COLLECTIONS_PATH="$PWD/ansible/collections" ansible-galaxy collection in echo "Done installing needed Ansible packages." echo "Running choosen Ansible Playbook at $choosen_playbook_path..." -ansible-playbook --ask-become-pass --inventory localhost, --module-path ansible/collections "$choosen_playbook_path" +ansible-playbook --inventory localhost, --module-path ansible/collections "$choosen_playbook_path" echo "Done running choosen Ansible Playbook. If this is your first installation, you might want to reboot in order for the settings to take effect."