-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented Cookiecutter #416
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"repo_name": "OVERRIDEN", | ||
"role_name": "OVERRIDEN", | ||
"instances": 2 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get how the variable in the path name works for this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It's a cookiecutter thing. Creates a directory named what we call the repo. In our case the repo is the name of the role we are creating. |
||
docker: | ||
containers: | ||
{%- for n in range(cookiecutter.instances|int) %} | ||
|
||
- name: {{ cookiecutter.role_name }}-{{ '%02d' % loop.index }} | ||
image: ubuntu | ||
image_version: latest | ||
ansible_groups: | ||
- group1 | ||
{%- endfor -%} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"repo_name": "OVERRIDEN", | ||
"role_name": "OVERRIDEN" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"repo_name": "OVERRIDEN", | ||
"role_name": "OVERRIDEN", | ||
"instances": 2, | ||
"platform_name": "OVERRIDEN", | ||
"platform_box": "OVERRIDEN", | ||
"platform_box_url": "OVERRIDEN", | ||
"provider_name": "virtualbox", | ||
"provider_type": "virtualbox", | ||
"provider_options_memory": 512, | ||
"provider_options_cpu": 2 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
vagrant: | ||
platforms: | ||
- name: {{ cookiecutter.platform_name }} | ||
box: {{ cookiecutter.platform_box }} | ||
box_url: {{ cookiecutter.platform_box_url }} | ||
|
||
providers: | ||
- name: {{ cookiecutter.provider_name }} | ||
type: {{ cookiecutter.provider_type }} | ||
options: | ||
memory: {{ cookiecutter.provider_options_memory }} | ||
cpus: {{ cookiecutter.provider_options_cpu }} | ||
|
||
instances: | ||
{%- for n in range(cookiecutter.instances|int) %} | ||
|
||
- name: {{ cookiecutter.role_name }}-{{ '%02d' % loop.index }} | ||
ansible_groups: | ||
- group1 | ||
{%- endfor -%} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"repo_name": "OVERRIDEN", | ||
"role_name": "OVERRIDEN" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Role Name | ||
========= | ||
|
||
A brief description of the role goes here. | ||
|
||
Requirements | ||
------------ | ||
|
||
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. | ||
|
||
Role Variables | ||
-------------- | ||
|
||
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. | ||
|
||
Dependencies | ||
------------ | ||
|
||
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. | ||
|
||
Example Playbook | ||
---------------- | ||
|
||
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: | ||
|
||
- hosts: servers | ||
roles: | ||
- { role: username.rolename, x: 42 } | ||
|
||
License | ||
------- | ||
|
||
BSD | ||
|
||
Author Information | ||
------------------ | ||
|
||
An optional section for the role authors to include contact information, or a website (HTML is not allowed). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# defaults file for {{ cookiecutter.role_name }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
# handlers file for {{ cookiecutter.role_name }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've probably implemented cookiecutter somewhat oddly here. Wanted modular templates, since we need to write an entire role tree with modular test suites. Other times we only want a couple files from the templates.
I figure we can iterate on this, and make it better as we learn more about cookiecutter. 🍪