Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/voxpupuli/beaker-hiera
Beaker DSL Extension Helpers!
https://github.com/voxpupuli/beaker-hiera
hacktoberfest
Last synced: about 1 month ago
JSON representation
Beaker DSL Extension Helpers!
- Host: GitHub
- URL: https://github.com/voxpupuli/beaker-hiera
- Owner: voxpupuli
- License: apache-2.0
- Created: 2015-08-21T17:27:32.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-07-23T13:12:53.000Z (5 months ago)
- Last Synced: 2024-10-29T14:22:31.027Z (about 1 month ago)
- Topics: hacktoberfest
- Language: Ruby
- Size: 106 KB
- Stars: 1
- Watchers: 94
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-puppet - beaker-hiera - Allows to use Hiera data in Beaker tests. (Puppet Tools / Modules Management)
- awesome-puppet - beaker-hiera - Allows to use Hiera data in Beaker tests. (Puppet Tools / Modules Management)
README
# beaker-hiera
[![License](https://img.shields.io/github/license/voxpupuli/beaker-hiera.svg)](https://github.com/voxpupuli/beaker-hiera/blob/master/LICENSE)
[![codecov](https://codecov.io/gh/voxpupuli/beaker-hiera/branch/master/graph/badge.svg?token=Mypkl78hvK)](https://codecov.io/gh/voxpupuli/beaker-hiera)
[![Release](https://github.com/voxpupuli/beaker-hiera/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/beaker-hiera/actions/workflows/release.yml)
[![RubyGem Version](https://img.shields.io/gem/v/beaker-hiera.svg)](https://rubygems.org/gems/beaker-hiera)
[![RubyGem Downloads](https://img.shields.io/gem/dt/beaker-hiera.svg)](https://rubygems.org/gems/beaker-hiera)
[![Donated by Puppet Inc](https://img.shields.io/badge/donated%20by-Puppet%20Inc-fb7047.svg)](#transfer-notice)Beaker Hiera DSL Extension Library! This allows to easily use Hiera data in acceptance tests.
## Usage
The `write_hiera_config_on` method is the most important one.
It writes the `hiera.yaml` file to the specified host or hosts.
The version is always set to 5, as well as a default `datadir`.
The `hierarchy` is directly what the [documentation](https://www.puppet.com/docs/puppet/7/hiera_config_yaml_5.html) specifies.
It is then important to also copy the data from a local directory to the same host or hosts.```ruby
hierarchy = [
{
'name' => 'Per-node data',
'path' => 'fqdn/%{facts.networking.fqdn}.yaml',
},
{
'name' => 'OS family version data',
'path' => 'family/%{facts.os.family}/%{facts.os.release.major}.yaml',
},
{
'name' => 'OS family data',
'path' => 'family/%{facts.os.family}.yaml',
},
{
'name' => 'Common data',
'path' => 'common.yaml',
},
]
write_hiera_config_on(host, hierarchy)
copy_hiera_data_to(host, 'spec/acceptance/hieradata')
```## Transfer Notice
This plugin was originally authored by [Puppet Inc](http://puppet.com).
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
Existing pull requests and issues were transferred over, please fork and continue to contribute here.Previously: https://github.com/puppetlabs/beaker-hiera
## License
This gem is licensed under the Apache-2 license.
## Release information
To make a new release, please do:
* update the version in `lib/beaker-hiera/version.rb`
* Install gems with `bundle install --with release --path .vendor`
* generate the changelog with `bundle exec rake changelog`
* Check if the new version matches the closed issues/PRs in the changelog
* Create a PR with it
* After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages