ansible/deploy.sh

19 lines
315 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2022-09-03 18:38:34 +02:00
if [ "$#" -lt 2 ]; then
echo "Usage: $0 <limit> <playbook> [playbook...]"
exit
fi
LIMIT=""
LIMIT_PRESENT=$(echo "$1" | grep ".yml")
if [ "${LIMIT_PRESENT}" == "" ]; then
LIMIT="--limit $1"
shift
fi
for PLAYBOOK in $@; do
ansible-playbook --forks 1 ${LIMIT} ${PLAYBOOK}
shift
done