sync/sync.sh

18 lines
393 B
Bash
Raw Normal View History

#!/bin/bash
2018-07-04 14:03:35 -04:00
\cd "$(dirname $0)"
if [ -z "$1" ]; then
echo "Usage:"
2018-07-05 17:07:42 -04:00
echo "$0 TAG1[,TAG2] [ANSIBLE-OPTS]"
2018-07-04 14:03:35 -04:00
echo "Available tags:"
echo "$(\ls roles | tr '\n' ' ')"
echo "Example: $0 default,vim"
exit 1
fi
2018-07-06 13:39:37 -04:00
if [ -f .env/bin/activate ]; then
echo "Found virtualenv. Sourcing..."
source .env/bin/activate
fi
2018-07-05 17:07:42 -04:00
TAGS="$1"
shift
ansible-playbook -i 'localhost,' $* main.yml --tags "$TAGS"