1
0
Fork 0
mirror of https://github.com/samsapti/bachelor-project.git synced 2024-11-21 20:37:55 +00:00

Add provision.sh

This commit is contained in:
Sam Al-Sapti 2023-04-18 15:46:11 +02:00
parent d75dc208c8
commit a2c3219ed0
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
2 changed files with 16 additions and 1 deletions

View file

@ -1,4 +1,3 @@
[defaults] [defaults]
remote_user = root
inventory = inventory inventory = inventory
use_persistent_connections = True use_persistent_connections = True

16
ansible/provision.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env sh
BASE_CMD="ansible-playbook playbook.yml -i inventory --ask-vault-pass"
if [ -z "$(ansible-galaxy collection list community.general 2>/dev/null)" ]; then
ansible-galaxy collection install community.general
fi
case $1 in
root)
$BASE_CMD -u root ;;
user)
$BASE_CMD --ask-become-pass -u mpc-player ;;
*)
exit 1 ;;
esac