Hiera::Fragment
The hiera-fragment gem uses a custom algorithm to merge YAML files together to produce output for Hiera. It is intended to allow secrets to be specified in separate files (eyaml supported). It also supports replacement of fragments of YAML which should result in a reduction of size of the configuration for Hiera
Installation
Install:
$ gem install hiera-fragment
Usage
fragment should be added as a backend to Hiera. A top-level :fragment key is used to configure hiera-fragment
:datadirArray of paths or single path to the fragments.:extensionsArray of extensions to search for.:inputdirsArray of paths or single path to the source files.:fragmentsArray of fragments, specified in the same way as:hierarchy:destdirDirectory to ouput modified files to. Defaults to:yaml[:datadir]
Only YAML (and eyaml) is currently supported
Example hiera.yaml file
---
:backends:
- fragment
- yaml
:hierarchy:
- source
:yaml:
:datadir: ./test/output
:logger: console
:fragment:
:datadir: ./test/fragment
:extensions:
- yaml
- eyaml
:inputdirs:
- ./test/input
:fragments:
- source
- foo
Source file:
---
key: 'value'
Fragment file
---
key: 'replaced value'
hiera -c hiera.yaml key will output 'replaced value'
License
avst-wizard is released under the terms of the Apache 2.0 license. See LICENSE.txt
Contributing
- Fork it ( https://github.com/adaptavist/hiera-fragment/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request