Skip to content

g2g/cookiecutter-ansible-role

 
 

Repository files navigation

Cookiecutter Ansible Role

Build Status

Cookiecutter recipe to easily create ansible roles. This is a fork from ferrarimarco/cookiecutter-ansible-role

Features

  1. Follows Ansible best practices
  2. Follows Ansible Galaxy best practices
  3. Only Creates the necessary files and folders
  4. Blazing fast creation, forget about file creation and focus in actions
  5. Lint checks (Ansible-lint, yamllint)
  6. Travis-CI integration ready, with support for parallel builds: (.travis.yml, badges in README.md for development and master branches)

Usage

  1. Install cookiecutter: pip install cookiecutter
  2. cookiecutter https://github.com/jobcespedes/cookiecutter-ansible-role

It will ask you questions about the structure of your role like tasks names, handlers names, and default variables. You can jump to the next question by entering an empty string.

Test the generated role

See README.md of the generated role.

Example

    ROLE CONFIGURATION:
    ===================

    Should it have tasks?  [Y/n]
      Add task name i.e (Install packages) Add some task
      Add task name i.e (Install packages) another task
      Add task name i.e (Install packages)

    Should it have handlers? [Y/n]
      Add handler name i.e (Restart uwsgi) restart something
      Add handler name i.e (Restart uwsgi) alert someone
      Add handler name i.e (Restart uwsgi)

    It should contain default variables?:  [Y/n]
      Add variable i.e (operator: : drunken_master) var: name
      Add variable i.e (operator: : drunken_master)

    Should it have meta info?  [Y/n]
     - Should it have dependencies?  [Y/n]
        Add dependency i.e ({role: aptsupercow, var: 'value'}) {role: cool, version: latest}
        Add dependency i.e ({role: aptsupercow, var: 'value'})

    Should it have templates?  [Y/n] n

    Should it have files?  [Y/n] y

About

Cookiecutter recipe to easily create ansible roles.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 81.5%
  • Shell 18.5%