datacoop.ansible/deploy.sh

29 lines
717 B
Bash
Raw Normal View History

#!/bin/sh
2021-03-04 12:52:25 +00:00
BASE_CMD="ansible-playbook playbook.yml --ask-vault-pass"
if [ -z "$(ansible-galaxy collection list community.general 2>/dev/null)" ]; then
echo "Installing community modules"
ansible-galaxy collection install community.general
fi
if [ -z "$1" ]; then
echo "Deploying all!"
$BASE_CMD
else
case $1 in
"services")
if [ -z "$2" ]; then
echo "Deploying all services!"
2019-02-15 09:21:06 +00:00
$BASE_CMD --tags setup_services
else
echo "Deploying services: $2"
2019-02-15 09:21:06 +00:00
$BASE_CMD --tags setup_services --extra-vars "services=$2"
fi
2022-11-11 21:16:22 +00:00
;;
"base")
$BASE_CMD --tags base_only
;;
esac
fi