Created
July 2, 2014 22:45
-
-
Save pol/e845be49480f88295a42 to your computer and use it in GitHub Desktop.
ansible-role shell script
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
| #!/bin/sh | |
| if [ $# -lt 1 ]; then | |
| echo "Usage: ansible-role ROLE ARGS...\n(see ansible-playbook --help for args)" | |
| exit 1 | |
| fi | |
| ROLE=$1 | |
| shift | |
| OPTS=$* | |
| echo "---\n- hosts: $ROLE\n roles:\n - $ROLE\n" > .tmp.yml | |
| ansible-playbook .tmp.yml $OPTS | |
| rm .tmp.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment