25 lines
805 B
Bash
Executable File
25 lines
805 B
Bash
Executable File
#!/bin/bash
|
|
\cd "$(dirname $0)"
|
|
if [ -z "$1" ]; then
|
|
echo "Usage:"
|
|
echo "$0 TAG1,TAG2"
|
|
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
|
|
ansible-playbook -i 'localhost,' main.yml --tags "$1"
|
|
# Could also sync vim:
|
|
# ansible-playbook -i hosts main.yml --tags default,vim
|
|
# vim +'call Initialize()' +'qa'
|
|
# Could also secure system
|
|
# ansible-playbook -i hosts --ask-become-pass main.yml --tags secure
|
|
# Disable password authentication
|
|
# ansible-playbook -i 'localhost,' --tags secure --extra-vars 'disable_passwordauth=true' main.yml --ask-become-pass
|
|
# Use 1.1.1.1 dns
|
|
# ansible-playbook -i 'localhost,' --tags dns main.yml --ask-become-pass
|