Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dalen/hiera-yamlerb
A YAML backend with ERB templating for Hiera. (Unmaintained, feel free to take over)
https://github.com/dalen/hiera-yamlerb
Last synced: 21 days ago
JSON representation
A YAML backend with ERB templating for Hiera. (Unmaintained, feel free to take over)
- Host: GitHub
- URL: https://github.com/dalen/hiera-yamlerb
- Owner: dalen
- License: apache-2.0
- Created: 2014-11-19T22:56:25.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-11-19T23:05:10.000Z (about 10 years ago)
- Last Synced: 2024-10-26T19:26:39.539Z (25 days ago)
- Language: Ruby
- Homepage:
- Size: 137 KB
- Stars: 1
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is a YAML+ERB backend for hiera. It works like the regular YAML backend
but allows you to also template the YAML file using ERB syntax on the entire
fact scope.This can be used to prevent a sprawl of hiera hierarchy levels that are only
used once or twice. Can also be used to reduce data duplication where several
different fact values should evaluate to the same value.However you might not want to put too much code back into your data once you
have actually separated your data and code, but up to you :)Examples:
=========Match on two different fact values instead of repeating that value in two
different YAML files:```
<% if ["Linux", "Darwin"].include? @kernel -%>
puppet::version: '3.7.3'
<% else -%>
puppet::version: '3.7.2'
<% end %>
```Use a hiera value for a range of fact values
```
<% if @processorcount.between?(4,8) -%>
apache::max_keepalive_requests: 200
<% end -%>
```Calculate a value for a hiera key:
```
puppetdb::max_treads: <%= [@processorcount - 1,1].max %>
```