Created
August 27, 2014 16:55
-
-
Save proxypoke/73029600a6c63d12e8a7 to your computer and use it in GitHub Desktop.
mkrole - create an ansible role skeleton
This file contains 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 | |
# create the directory structure and some files | |
# for an ansible role | |
ROLE=$1 | |
if [ -z "$ROLE" ]; then | |
echo "need a role name" | |
exit 1 | |
fi | |
mkdir -p $ROLE/{tasks,handlers,templates,files,vars,meta} | |
echo "---" | tee $ROLE/{tasks,handlers,vars,meta}/main.yml > /dev/null |
This only works if sh is an alias to bash (which is very often not true) - I've had to change the shebang to point at bash. Sorry for commenting instead of creating a PR - that seemed a bit too excessive for adding two characters into your script! :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good use of
tee