Last active
May 22, 2018 13:03
-
-
Save cjlyth/61051da5b14f0f03a2fb460a37abed92 to your computer and use it in GitHub Desktop.
Bash function to create Ansible roles following (current) best practices
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
# http://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#directory-layout | |
mkrole() | |
{ | |
dir_name=${1:-'common'} | |
mkdir -p roles/$dir_name/{tasks,handlers,templates,files,vars,defaults,meta} | |
touch roles/$dir_name/{tasks,handlers,vars,defaults,meta}/main.yml | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment