mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 11:02:13 +02:00
now allowing the user to provide the path to a playbook to speed up the
installation process
This commit is contained in:
@@ -4,6 +4,7 @@ ERROR_BECAUSE_ROOT=1
|
||||
ERROR_BECAUSE_NOT_ARCH_LINUX=2
|
||||
ERROR_BECAUSE_ANSIBLE_INSTALLATION_FAILED=3
|
||||
ERROR_BECAUSE_PLAYBOOK_INVALID_OR_NOT_FOUND=4
|
||||
ERROR_BECAUSE_PLAYBOOK_PATH_DOES_NOT_EXIST=5
|
||||
|
||||
if [[ "$(id -u)" -eq 0 ]]
|
||||
then
|
||||
@@ -60,6 +61,12 @@ then
|
||||
exit $ERROR_BECAUSE_PLAYBOOK_INVALID_OR_NOT_FOUND
|
||||
fi
|
||||
|
||||
if [[ ! -f $choosen_playbook_path ]]
|
||||
then
|
||||
echo "Error: playbook path $choosen_playbook_path does not exist on the file system."
|
||||
exit $ERROR_BECAUSE_PLAYBOOK_PATH_DOES_NOT_EXIST
|
||||
fi
|
||||
|
||||
echo "Installing needed Ansible packages..."
|
||||
|
||||
ANSIBLE_COLLECTIONS_PATH="$PWD/ansible/collections" ansible-galaxy collection install --collections-path ansible/collections --requirements-file ansible/galaxy/requirements.yml
|
||||
|
||||
Reference in New Issue
Block a user