25 lines
596 B
Bash
Executable File
25 lines
596 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# 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
|
|
|
|
\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
|
|
TAGS="$1"
|
|
shift
|
|
ansible-playbook -i 'localhost,' $* main.yml --tags "$TAGS"
|