Chris Mague 7 лет назад
Сommit
0edbb15a6f
4 измененных файлов с 58 добавлено и 0 удалено
  1. 17 0
      README.md
  2. 7 0
      cookiecutter.json
  3. 17 0
      hooks/pre_gen_project.py
  4. 17 0
      {{cookiecutter.module_name}}/README.md

+ 17 - 0
README.md

@@ -0,0 +1,17 @@
+# cookiecutter-ansible-role
+
+This builds and ansible role with a Vagrantfile for testing in vagrant
+
+## Prerequisites 
+
+ Install cookiecutter
+```
+sudo pip install cookiecutter
+```
+
+Optionally to test using Vagrant:
+Install and configure [virtualbox](https://www.virtualbox.org/wiki/Downloads) and [vagrant](https://www.vagrantup.com/)
+
+## Using 
+
+cookiecutter https://gogs.mague.com/Shokunin/cookiecutter-ansible-role.git 

+ 7 - 0
cookiecutter.json

@@ -0,0 +1,7 @@
+{
+  "full_name": "Chris Mague",
+  "email": "github@mague.com",
+  "short_description": "description goes here",
+  "module_name": "test",
+  "date": ""
+}

+ 17 - 0
hooks/pre_gen_project.py

@@ -0,0 +1,17 @@
+#! /usr/bin/env python
+
+from cookiecutter.main import cookiecutter
+
+import datetime
+import os
+
+now = datetime.datetime.now()
+
+
+rstring = ''.join([c for c in os.urandom(1024)
+                   if c.isalnum()])[:64]
+
+cookiecutter(
+    'cookiecutter-terraform-module',     # path/url to cookiecutter template
+    extra_context={'secret': rstring},
+)

+ 17 - 0
{{cookiecutter.module_name}}/README.md

@@ -0,0 +1,17 @@
+# {{cookiecutter.module_name}}
+
+{{cookiecutter.short_description}}
+
+## Usage
+
+`ansible-galaxy install {{ cookiecutter.module_name }}`
+
+LICENSE: 3-clause BSD license.
+
+
+## Testing
+
+`cd {{ cookiecutter.module_name }} && vagrant up`
+
+
+{{ cookiecutter.generated }}