1
0
Fork 0
mirror of https://github.com/samsapti/bachelor-project.git synced 2024-12-01 17:17:54 +00:00
bachelor-project/ansible/provision.sh

17 lines
376 B
Bash
Raw Normal View History

2023-04-18 13:46:11 +00:00
#!/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