Created
March 25, 2021 17:35
-
-
Save yanick/744312c7503a31f249d3549e3e91a560 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# always wanted Ansible to be --check by default. | |
# Well, through the magic of arg munging, it can be! | |
# add `--check --diff` to all commands, unless it ends | |
# with GO | |
# E.g., | |
# ansiplay playbooks/foo.yml # --check and --diff added | |
# ansiplay playbooks/foo.yml GO # GO removed and playbook ran fo' realz | |
# also added `!@` as a shortcut for --skip-tags. Because lazy. | |
set argv ( echo $argv | perl -pe 's/\@!/--skip-tags /' ) | |
set argv ( echo $argv | perl -pe 's/GO// or s/$/ --check --diff/' ) | |
eval ansible-playbook $argv |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment