aboutsummaryrefslogblamecommitdiffhomepage
path: root/ubuntu14.04-onbuild/ansible-playbook-wrapper
blob: bf137c814c69ac515e0f111688fd50b8a204e08d (plain) (tree)





























                                                                      
#!/bin/sh
#
# Simple wrapper for executing ansible-playbook with local connection.
#
# USAGE:
#    ansible-playbook-wrapper  [other ansible-playbook arguments]
#
# ENVIRONMENT VARIABLES:
# 
#    - PLAYBOOK: playbook filename;   default = "playbook.yml"
#    - INVENTORY: inventory filename; default = "/etc/ansible/hosts"
# 


if [ -z "$PLAYBOOK" ]; then
    PLAYBOOK=playbook.yml
fi


if [ -z "$INVENTORY" ]; then
    exec ansible-playbook        \
       $PLAYBOOK                 \
       --connection=local        \
       "$@"
else
    exec ansible-playbook        \
       -i $INVENTORY  $PLAYBOOK  \
       --connection=local        \
       "$@"
fi