This template can be used to generate customized ansible role.
role_name
- What name to use for generated roledefaults_needed
- Select if you need defaults folderdocs_needed
- Select if you need docs folderfiles_needed
- Select if you need files folderhandlers_needed
- Select if you need handlers foldertemplates_needed
- Select if you need templates foldervars_needed
- Select if you need vars foldertests_needed
- Select if you need tests folderauthor
- Author's name & e-mailcompany
- Name of the companydescription
- Description about what role doesissue_tracker_url
- Link to issues tracker, if existmin_ansible_version
- Minimal Ansible version, default 2.5platforms
- List of platforms, separated by; and : and ,
, for example:EL:all;Debian:jessie,stretch;Ubuntu:xenial,bionic
galaxy_tags
- List of tags (separated by,
)dependencies
- List of dependencies (separated by,
)
P.S. (Note that if you want to use repository name like ansible-role-xxx
, don't put ansible-role-
to role_name). And you cannot use -
in role name.
- Install cookiecutter
pip install cookiecutter
- Run
cookiecutter https://github.com/cndies/cc-ansible-role-template.git
- Answer questions, and after that you will get a new module folder in current directory
- Add variables to cookiecutter.json
- Use them in templates as
cookiecutter.<variable_name>
- You cannot use dashes
-
in variable name!