mirror of
https://github.com/samsapti/bachelor-project.git
synced 2024-11-21 12:27:55 +00:00
Add provision.sh
This commit is contained in:
parent
d75dc208c8
commit
a2c3219ed0
|
@ -1,4 +1,3 @@
|
|||
[defaults]
|
||||
remote_user = root
|
||||
inventory = inventory
|
||||
use_persistent_connections = True
|
||||
|
|
16
ansible/provision.sh
Executable file
16
ansible/provision.sh
Executable 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
|
Loading…
Reference in a new issue