Skip to content

Instantly share code, notes, and snippets.

@evilr00t
Created February 21, 2018 10:59
Show Gist options
  • Save evilr00t/5fc46ef54f4d63619d66f87217dafa50 to your computer and use it in GitHub Desktop.
Save evilr00t/5fc46ef54f4d63619d66f87217dafa50 to your computer and use it in GitHub Desktop.
ansible with sudo password - shortcut
apb()
{
if [ ! -z "$ANSIBLE_BECOME_PASS" ]; then
ansible-playbook -e "ansible_become_pass=$ANSIBLE_BECOME_PASS" $@
else
echo "[I] Did you forget about: "
echo -e "\e[31mexport ANSIBLE_BECOME_PASS=XXX\e[0m"
echo "[I] Oh, yes... you do!"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment