erb-hiera 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e7a7eccf95ab13b30f77330304df912eb810f9c
4
- data.tar.gz: 2ab840ff77638d23057fd1054b94afffd430744b
3
+ metadata.gz: 3a6f2b4aa5eea06a3ce6db8a7d2d1bf9a21f8e12
4
+ data.tar.gz: a4358d3c004e05a31fafb0b4f2c94492ad1f71d2
5
5
  SHA512:
6
- metadata.gz: e56b429402ef40b17a23898f30451d28f8588ac2b7e1bdac13887fad5765ed2def3e2245cdb93d9b4f9ad6e486da52d84386d6c7dc24764bc74e27a21e17defe
7
- data.tar.gz: 218476393e543e827fcd10ddba6fffeabc0730433cf252835e292ac885b7e9a422cc6571cf520db99a4e2c3330e6c4174385107e1eac6e3ff661f85a6ac4ad32
6
+ metadata.gz: 40c3159c55add88589e2afd08d5081631f1146c5f94daf972274bb417c8e81786ff2c884798762fc86cdb0406423047a59bceb9273a4fd4f6d6f859a1bfe3e3b
7
+ data.tar.gz: ea6e6132bf150202d86157c6db3f3cb06cd8aa0a21c2afbbebc754dc934a93984a9828df79188e24e30fdbeef662dc1cb955ae80b70cda778f23277c2ff944e3
data/README.md CHANGED
@@ -1,7 +1,35 @@
1
1
  # erb-hiera
2
2
 
3
+ ## About
4
+
5
+ Generate documents from a scope, ERB template(s) and Hiera Data
6
+
3
7
  ## Install
4
8
 
5
9
  ```
6
10
  gem install erb-hiera
7
11
  ```
12
+
13
+ ## Usage
14
+
15
+ ```
16
+ $ ./bin/erb-hiera --help
17
+ Options:
18
+ --config=<s> specify config file
19
+ --hiera-config=<s> specify hiera config file
20
+ --dry-run don't write out files
21
+ --verbose print compiled template(s)
22
+ --debug print backtrace on error
23
+ ```
24
+
25
+ ## Example
26
+
27
+ ```
28
+ cd example
29
+ erb-hiera --config config.yaml --hiera-config hiera.yaml --verbose
30
+ ```
31
+
32
+ ## References
33
+
34
+ * [erb](http://www.stuartellis.name/articles/erb/#writing-templates)
35
+ * [hiera](https://docs.puppet.com/hiera/)
@@ -0,0 +1,10 @@
1
+ - scope:
2
+ environment: dev
3
+ in_dir: templates
4
+ out_dir: output/dev
5
+
6
+ - scope:
7
+ environment: stage
8
+ in_dir: templates
9
+ out_dir: output/stage
10
+
@@ -0,0 +1,12 @@
1
+ :backends:
2
+ - yaml
3
+
4
+ :yaml:
5
+ :datadir: "hiera"
6
+
7
+ :hierarchy:
8
+ # globals / environment
9
+ - "environment/%{environment}"
10
+
11
+ # globals
12
+ - "common"
@@ -0,0 +1 @@
1
+ common: "some common variable"
@@ -0,0 +1 @@
1
+ environment::description: "this is the development environment"
@@ -0,0 +1 @@
1
+ environment::description: "this is the staging environment"
@@ -0,0 +1,2 @@
1
+ Global: some global variable
2
+ Environment Description: this is the development environment
@@ -0,0 +1,2 @@
1
+ Global: some global variable
2
+ Environment Description: this is the staging environment
@@ -0,0 +1,2 @@
1
+ common variable: <%= hiera("common") %>
2
+ environment variable: <%= hiera("environment::description") %>
data/lib/erb-hiera.rb CHANGED
@@ -47,6 +47,6 @@ module ErbHiera
47
47
  end
48
48
 
49
49
  def self.manifests(dir)
50
- Dir.glob(File.join(dir, "**", "*.yaml"))
50
+ Dir.glob(File.join(dir, "**", "*"))
51
51
  end
52
52
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  module ErbHiera
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erb-hiera
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Wilson
@@ -103,6 +103,14 @@ extra_rdoc_files: []
103
103
  files:
104
104
  - README.md
105
105
  - bin/erb-hiera
106
+ - example/config.yaml
107
+ - example/hiera.yaml
108
+ - example/hiera/common.yaml
109
+ - example/hiera/environment/dev.yaml
110
+ - example/hiera/environment/stage.yaml
111
+ - example/output/dev/template.txt
112
+ - example/output/stage/template.txt
113
+ - example/templates/template.txt
106
114
  - lib/erb-hiera.rb
107
115
  - lib/erb-hiera/cli.rb
108
116
  - lib/erb-hiera/directory.rb