Skip to content

Instantly share code, notes, and snippets.

@paul-english
Created January 29, 2016 17:07
Show Gist options
  • Save paul-english/e473d3e33fdb8ef271d1 to your computer and use it in GitHub Desktop.
Save paul-english/e473d3e33fdb8ef271d1 to your computer and use it in GitHub Desktop.
ansible-playbook
#!/usr/bin/env bash
# Place this script in a directory that preceeds the location of
# the real ansible-playbook script in your PATH. When run, it
# will add passwords found in the .ansible-vars file, then call
# the real ansible-playbook script.
set -e
#set -x
function detect_check_and_load () {
[ -f "$1" ] || return 0
chmod 0600 "$1"
. "$1"
}
detect_check_and_load "$HOME/.ansible-vars"
detect_check_and_load "./.ansible-vars"
exec "$ANSIBLE_HOME/bin/ansible-playbook" $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment