iknite / cookiecutter-ansible-role

Cookie cutter recipe to easily create ansible roles.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cookiecutter Ansible Role

Cookie cutter recipe to easily create ansible roles. It infuses antigravity (or maybe not).

Features

  • Follows best practices.
  • Only Creates the necessary files and folders.
  • Blazing fast creation, forget about file creation and focus in actions.

Usage

cookiecutter https://github.com/iknite/cookiecutter-ansible-role.git

It begin to ask you configuration variables then you can enter tasks names, handlers names, and default variables.

Inside a Add <some> name i.e (<example>) you can go to next section by entering an empty string.

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

This will generate this folders (Please note the absence of templates folder):

.
├── CONTRIBUTORS.txt
├── defaults
│   └── main.yml
├── files
├── handlers
│   └── main.yml
├── LICENSE.rst
├── meta
│   └── main.yml
├── README.rst
└── tasks
    └── main.yml

Contributions

All contributions are more than welcome, please do so.

License

  • 3-clause BSD license.
  • Copyright ©2014, Enrique Paredes
  • Enjoy it!

About

Cookie cutter recipe to easily create ansible roles.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%