sync/sync.sh

18 lines
393 B
Bash
Executable File

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