sync/sync.sh

25 lines
596 B
Bash
Raw Normal View History

#!/bin/bash
2018-07-05 17:07:42 -04:00
# Examples
# Secure SSH
# ./sync.sh secure --ask-become-pass --tags
# Disable SSH password authentication
# ./sync.sh secure --extra-vars 'disable_passwordauth=true' --ask-become-pass
# Use 1.1.1.1 dns
# ./sync.sh dns --ask-become-pass
# Sync for root
# ./sync.sh default,vim --become --ask-become-pass
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-05 17:07:42 -04:00
TAGS="$1"
shift
ansible-playbook -i 'localhost,' $* main.yml --tags "$TAGS"