beaker-hiera 0.6.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +4 -4
- data/.github/workflows/test.yml +5 -4
- data/.rubocop_todo.yml +10 -1
- data/CHANGELOG.md +33 -1
- data/README.md +53 -4
- data/Rakefile +3 -10
- data/beaker-hiera.gemspec +2 -2
- data/lib/beaker-hiera/helpers.rb +9 -7
- data/lib/beaker-hiera/version.rb +1 -1
- data/spec/beaker-hiera/helpers_spec.rb +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09b212e362fa594e532f6492163977dc3535be4aef9bd8fafeda5f0bff798ac1'
|
4
|
+
data.tar.gz: 9cb843cc2055ebc4c213cc5ac51c99669ae10d7bfec1835db916cc45c0a55379
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b50166b1991e2a83795d36a790737cd09f7dd9e1ee8544842bf55970cad54b59df4ff7cbc7cb56265013dc23f73570b1ab128542f7b418e4adf5c56f6ffa36a4
|
7
|
+
data.tar.gz: 3e47767c8da360497cd526be181855582f92e97d383dff5d6e10641dcee4717b38661f9e26b8bf618a74d08e7c8c82d27b4e86412872fa334275811a225a44c5
|
@@ -10,15 +10,15 @@ jobs:
|
|
10
10
|
runs-on: ubuntu-latest
|
11
11
|
if: github.repository_owner == 'voxpupuli'
|
12
12
|
steps:
|
13
|
-
- uses: actions/checkout@
|
14
|
-
- name: Install Ruby 3.
|
13
|
+
- uses: actions/checkout@v4
|
14
|
+
- name: Install Ruby 3.3
|
15
15
|
uses: ruby/setup-ruby@v1
|
16
16
|
with:
|
17
|
-
ruby-version: '3.
|
17
|
+
ruby-version: '3.3'
|
18
18
|
env:
|
19
19
|
BUNDLE_WITHOUT: release:development:rubocop
|
20
20
|
- name: Build gem
|
21
|
-
run: gem build *.gemspec
|
21
|
+
run: gem build --strict --verbose *.gemspec
|
22
22
|
- name: Publish gem to rubygems.org
|
23
23
|
run: gem push *.gem
|
24
24
|
env:
|
data/.github/workflows/test.yml
CHANGED
@@ -13,11 +13,11 @@ jobs:
|
|
13
13
|
rubocop:
|
14
14
|
runs-on: ubuntu-latest
|
15
15
|
steps:
|
16
|
-
- uses: actions/checkout@
|
16
|
+
- uses: actions/checkout@v4
|
17
17
|
- name: Install Ruby ${{ matrix.ruby }}
|
18
18
|
uses: ruby/setup-ruby@v1
|
19
19
|
with:
|
20
|
-
ruby-version: "
|
20
|
+
ruby-version: "3.3"
|
21
21
|
bundler-cache: true
|
22
22
|
- name: Run Rubocop
|
23
23
|
run: bundle exec rake rubocop
|
@@ -32,11 +32,12 @@ jobs:
|
|
32
32
|
- ruby: "3.0"
|
33
33
|
- ruby: "3.1"
|
34
34
|
- ruby: "3.2"
|
35
|
+
- ruby: "3.3"
|
35
36
|
env:
|
36
37
|
COVERAGE: ${{ matrix.coverage }}
|
37
38
|
name: RSpec - Ruby ${{ matrix.ruby }}
|
38
39
|
steps:
|
39
|
-
- uses: actions/checkout@
|
40
|
+
- uses: actions/checkout@v4
|
40
41
|
- name: Install Ruby ${{ matrix.ruby }}
|
41
42
|
uses: ruby/setup-ruby@v1
|
42
43
|
with:
|
@@ -45,7 +46,7 @@ jobs:
|
|
45
46
|
- name: spec tests
|
46
47
|
run: bundle exec rake test
|
47
48
|
- name: Build gem
|
48
|
-
run: gem build *.gemspec
|
49
|
+
run: gem build --strict --verbose *.gemspec
|
49
50
|
|
50
51
|
tests:
|
51
52
|
needs:
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2024-05-28 09:37:31 UTC using RuboCop version 1.63.5.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
@@ -12,6 +12,7 @@
|
|
12
12
|
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
13
13
|
Naming/FileName:
|
14
14
|
Exclude:
|
15
|
+
- 'Rakefile.rb'
|
15
16
|
- 'lib/beaker-hiera.rb'
|
16
17
|
|
17
18
|
# Offense count: 1
|
@@ -38,6 +39,14 @@ RSpec/NamedSubject:
|
|
38
39
|
Exclude:
|
39
40
|
- 'spec/beaker-hiera/helpers_spec.rb'
|
40
41
|
|
42
|
+
# Offense count: 1
|
43
|
+
# Configuration parameters: Include, CustomTransform, IgnoreMethods, IgnoreMetadata.
|
44
|
+
# Include: **/*_spec.rb
|
45
|
+
RSpec/SpecFilePathFormat:
|
46
|
+
Exclude:
|
47
|
+
- '**/spec/routing/**/*'
|
48
|
+
- 'spec/beaker-hiera/helpers_spec.rb'
|
49
|
+
|
41
50
|
# Offense count: 2
|
42
51
|
RSpec/StubbedMock:
|
43
52
|
Exclude:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,38 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.1.1](https://github.com/voxpupuli/beaker-hiera/tree/1.1.1) (2024-05-28)
|
4
|
+
|
5
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-hiera/compare/1.1.0...1.1.1)
|
6
|
+
|
7
|
+
There were some problems with the CI pipeline, so the 1.1.0 release was only published to GitHub packages, not to rubygems.org. This is fixed with the 1.1.1 release.
|
8
|
+
|
9
|
+
**Fixed bugs:**
|
10
|
+
|
11
|
+
- Fix typo in CI config [\#36](https://github.com/voxpupuli/beaker-hiera/pull/36) ([bastelfreak](https://github.com/bastelfreak))
|
12
|
+
|
13
|
+
## [1.1.0](https://github.com/voxpupuli/beaker-hiera/tree/1.1.0) (2024-05-28)
|
14
|
+
|
15
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-hiera/compare/1.0.0...1.1.0)
|
16
|
+
|
17
|
+
**Implemented enhancements:**
|
18
|
+
|
19
|
+
- beaker: Allow 6.x [\#34](https://github.com/voxpupuli/beaker-hiera/pull/34) ([bastelfreak](https://github.com/bastelfreak))
|
20
|
+
- Add Ruby 3.3 to CI matrix [\#33](https://github.com/voxpupuli/beaker-hiera/pull/33) ([bastelfreak](https://github.com/bastelfreak))
|
21
|
+
|
22
|
+
**Merged pull requests:**
|
23
|
+
|
24
|
+
- voxpupuli-rubocop: Require 2.7.0 [\#32](https://github.com/voxpupuli/beaker-hiera/pull/32) ([bastelfreak](https://github.com/bastelfreak))
|
25
|
+
- CI: Build gems with strict and verbose mode [\#31](https://github.com/voxpupuli/beaker-hiera/pull/31) ([bastelfreak](https://github.com/bastelfreak))
|
26
|
+
- README.md: Add badges, transfer notice and release information [\#30](https://github.com/voxpupuli/beaker-hiera/pull/30) ([bastelfreak](https://github.com/bastelfreak))
|
27
|
+
|
28
|
+
## [1.0.0](https://github.com/voxpupuli/beaker-hiera/tree/1.0.0) (2023-11-03)
|
29
|
+
|
30
|
+
[Full Changelog](https://github.com/voxpupuli/beaker-hiera/compare/0.6.0...1.0.0)
|
31
|
+
|
32
|
+
**Breaking changes:**
|
33
|
+
|
34
|
+
- Convert to Hiera 5 [\#17](https://github.com/voxpupuli/beaker-hiera/pull/17) ([ekohl](https://github.com/ekohl))
|
35
|
+
|
3
36
|
## [0.6.0](https://github.com/voxpupuli/beaker-hiera/tree/0.6.0) (2023-05-05)
|
4
37
|
|
5
38
|
[Full Changelog](https://github.com/voxpupuli/beaker-hiera/compare/0.5.0...0.6.0)
|
@@ -24,7 +57,6 @@
|
|
24
57
|
|
25
58
|
**Merged pull requests:**
|
26
59
|
|
27
|
-
- Bump actions/checkout from 2 to 3 [\#23](https://github.com/voxpupuli/beaker-hiera/pull/23) ([dependabot[bot]](https://github.com/apps/dependabot))
|
28
60
|
- Implement rubocop & fix violations [\#22](https://github.com/voxpupuli/beaker-hiera/pull/22) ([bastelfreak](https://github.com/bastelfreak))
|
29
61
|
- dependabot: check for github actions and gems [\#21](https://github.com/voxpupuli/beaker-hiera/pull/21) ([bastelfreak](https://github.com/bastelfreak))
|
30
62
|
|
data/README.md
CHANGED
@@ -1,14 +1,63 @@
|
|
1
1
|
# beaker-hiera
|
2
2
|
|
3
|
+
[![License](https://img.shields.io/github/license/voxpupuli/beaker-hiera.svg)](https://github.com/voxpupuli/beaker-hiera/blob/master/LICENSE)
|
4
|
+
[![codecov](https://codecov.io/gh/voxpupuli/beaker-hiera/branch/master/graph/badge.svg?token=Mypkl78hvK)](https://codecov.io/gh/voxpupuli/beaker-hiera)
|
5
|
+
[![Release](https://github.com/voxpupuli/beaker-hiera/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/beaker-hiera/actions/workflows/release.yml)
|
6
|
+
[![RubyGem Version](https://img.shields.io/gem/v/beaker-hiera.svg)](https://rubygems.org/gems/beaker-hiera)
|
7
|
+
[![RubyGem Downloads](https://img.shields.io/gem/dt/beaker-hiera.svg)](https://rubygems.org/gems/beaker-hiera)
|
8
|
+
[![Donated by Puppet Inc](https://img.shields.io/badge/donated%20by-Puppet%20Inc-fb7047.svg)](#transfer-notice)
|
9
|
+
|
3
10
|
Beaker Hiera DSL Extension Library! This allows to easily use Hiera data in acceptance tests.
|
4
11
|
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
The `write_hiera_config_on` method is the most important one.
|
15
|
+
It writes the `hiera.yaml` file to the specified host or hosts.
|
16
|
+
The version is always set to 5, as well as a default `datadir`.
|
17
|
+
The `hierarchy` is directly what the [documentation](https://www.puppet.com/docs/puppet/7/hiera_config_yaml_5.html) specifies.
|
18
|
+
It is then important to also copy the data from a local directory to the same host or hosts.
|
19
|
+
|
5
20
|
```ruby
|
6
21
|
hierarchy = [
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
22
|
+
{
|
23
|
+
'name' => 'Per-node data',
|
24
|
+
'path' => 'fqdn/%{facts.networking.fqdn}.yaml',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
'name' => 'OS family version data',
|
28
|
+
'path' => 'family/%{facts.os.family}/%{facts.os.release.major}.yaml',
|
29
|
+
},
|
30
|
+
{
|
31
|
+
'name' => 'OS family data',
|
32
|
+
'path' => 'family/%{facts.os.family}.yaml',
|
33
|
+
},
|
34
|
+
{
|
35
|
+
'name' => 'Common data',
|
36
|
+
'path' => 'common.yaml',
|
37
|
+
},
|
11
38
|
]
|
12
39
|
write_hiera_config_on(host, hierarchy)
|
13
40
|
copy_hiera_data_to(host, 'spec/acceptance/hieradata')
|
14
41
|
```
|
42
|
+
|
43
|
+
## Transfer Notice
|
44
|
+
|
45
|
+
This plugin was originally authored by [Puppet Inc](http://puppet.com).
|
46
|
+
The maintainer preferred that Puppet Community take ownership of the module for future improvement and maintenance.
|
47
|
+
Existing pull requests and issues were transferred over, please fork and continue to contribute here.
|
48
|
+
|
49
|
+
Previously: https://github.com/puppetlabs/beaker-hiera
|
50
|
+
|
51
|
+
## License
|
52
|
+
|
53
|
+
This gem is licensed under the Apache-2 license.
|
54
|
+
|
55
|
+
## Release information
|
56
|
+
|
57
|
+
To make a new release, please do:
|
58
|
+
* update the version in `lib/beaker-hiera/version.rb`
|
59
|
+
* Install gems with `bundle install --with release --path .vendor`
|
60
|
+
* generate the changelog with `bundle exec rake changelog`
|
61
|
+
* Check if the new version matches the closed issues/PRs in the changelog
|
62
|
+
* Create a PR with it
|
63
|
+
* After it got merged, push a tag. GitHub actions will do the actual release to rubygems and GitHub Packages
|
data/Rakefile
CHANGED
@@ -22,7 +22,7 @@ rescue LoadError
|
|
22
22
|
# github_changelog_generator is an optional release
|
23
23
|
else
|
24
24
|
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
|
25
|
-
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog]
|
25
|
+
config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog github_actions]
|
26
26
|
config.user = 'voxpupuli'
|
27
27
|
config.project = 'beaker-hiera'
|
28
28
|
gem_version = Gem::Specification.load("#{config.project}.gemspec").version
|
@@ -31,14 +31,7 @@ else
|
|
31
31
|
end
|
32
32
|
|
33
33
|
begin
|
34
|
-
require 'rubocop/
|
34
|
+
require 'voxpupuli/rubocop/rake'
|
35
35
|
rescue LoadError
|
36
|
-
#
|
37
|
-
else
|
38
|
-
RuboCop::RakeTask.new(:rubocop) do |task|
|
39
|
-
# These make the rubocop experience maybe slightly less terrible
|
40
|
-
task.options = ['--display-cop-names', '--display-style-guide', '--extra-details']
|
41
|
-
# Use Rubocop's Github Actions formatter if possible
|
42
|
-
task.formatters << 'github' if ENV['GITHUB_ACTIONS']
|
43
|
-
end
|
36
|
+
# the voxpupuli-rubocop gem is optional
|
44
37
|
end
|
data/beaker-hiera.gemspec
CHANGED
@@ -22,8 +22,8 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency 'rake', '~> 13.0'
|
23
23
|
s.add_development_dependency 'rspec', '~> 3.0'
|
24
24
|
s.add_development_dependency 'simplecov', '~> 0.22.0'
|
25
|
-
s.add_development_dependency 'voxpupuli-rubocop', '~>
|
25
|
+
s.add_development_dependency 'voxpupuli-rubocop', '~> 2.7.0'
|
26
26
|
|
27
27
|
# Run time dependencies
|
28
|
-
s.add_runtime_dependency 'beaker', '>= 4', '<
|
28
|
+
s.add_runtime_dependency 'beaker', '>= 4', '< 7'
|
29
29
|
end
|
data/lib/beaker-hiera/helpers.rb
CHANGED
@@ -9,17 +9,19 @@ module Beaker
|
|
9
9
|
# @param [Host, Array<Host>, String, Symbol] host
|
10
10
|
# One or more hosts to act upon, or a role (String or Symbol) that
|
11
11
|
# identifies one or more hosts.
|
12
|
-
# @param [Array] hierarchy
|
13
|
-
#
|
12
|
+
# @param [Array[Hash[String, String]]] hierarchy
|
13
|
+
# The hierachy as specified in Hiera config YAML version 5
|
14
|
+
#
|
15
|
+
# @see https://www.puppet.com/docs/puppet/7/hiera_config_yaml_5.html
|
14
16
|
def write_hiera_config_on(host, hierarchy)
|
15
17
|
block_on host do |hst|
|
16
18
|
hiera_config = {
|
17
|
-
|
18
|
-
|
19
|
-
datadir
|
19
|
+
'version' => 5,
|
20
|
+
'defaults' => {
|
21
|
+
'datadir' => hiera_datadir(hst),
|
22
|
+
'data_hash' => 'yaml_data',
|
20
23
|
},
|
21
|
-
hierarchy
|
22
|
-
logger: 'console',
|
24
|
+
'hierarchy' => hierarchy,
|
23
25
|
}
|
24
26
|
create_remote_file hst, hst.puppet['hiera_config'], hiera_config.to_yaml
|
25
27
|
end
|
data/lib/beaker-hiera/version.rb
CHANGED
@@ -19,7 +19,7 @@ describe ClassMixedWithDSLHelpers do
|
|
19
19
|
end
|
20
20
|
|
21
21
|
describe '#write_hiera_config_on' do
|
22
|
-
let(:hierarchy) { [
|
22
|
+
let(:hierarchy) { [{ 'name' => 'common', 'path' => 'common.yaml' }] }
|
23
23
|
|
24
24
|
it 'on host' do
|
25
25
|
expect(subject).to receive(:create_remote_file).with(host, '/usr/face', %r{datadir: "/usr/code/hieradata"})
|
@@ -28,7 +28,7 @@ describe ClassMixedWithDSLHelpers do
|
|
28
28
|
end
|
29
29
|
|
30
30
|
describe '#write_hiera_config' do
|
31
|
-
let(:hierarchy) { [
|
31
|
+
let(:hierarchy) { [{ 'name' => 'common', 'path' => 'common.yaml' }] }
|
32
32
|
|
33
33
|
it 'delegates to #write_hiera_config_on with the default host' do
|
34
34
|
expect(subject).to receive(:default).and_return(host)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beaker-hiera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-05-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: pry
|
@@ -73,14 +73,14 @@ dependencies:
|
|
73
73
|
requirements:
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
76
|
+
version: 2.7.0
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version:
|
83
|
+
version: 2.7.0
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: beaker
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
version: '4'
|
91
91
|
- - "<"
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
93
|
+
version: '7'
|
94
94
|
type: :runtime
|
95
95
|
prerelease: false
|
96
96
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -100,7 +100,7 @@ dependencies:
|
|
100
100
|
version: '4'
|
101
101
|
- - "<"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '7'
|
104
104
|
description: For use for the Beaker acceptance testing tool
|
105
105
|
email:
|
106
106
|
- voxpupuli@groups.io
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
requirements: []
|
154
|
-
rubygems_version: 3.
|
154
|
+
rubygems_version: 3.5.9
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Hiera DSL Helpers!
|