Skip to content

Commit

Permalink
Use beaker-hiera 1.x with hiera.yaml version 5
Browse files Browse the repository at this point in the history
The beaker-hiera 1.x release updates the suite configuration to version
5. This avoids a deprecation warning and Puppet 8 reportedly also
dropped version 3.

This also changes the hierarchy from os/$family to family/$family. This
is important to distinguish RedHat, which can be both an OS and a
family.
  • Loading branch information
ekohl committed Nov 3, 2023
1 parent 0e673e2 commit d06c892
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,22 @@ RSpec.configure do |c|
c.suite_hiera = true
c.suite_hiera_data_dir = File.join('spec', 'acceptance', 'hieradata')
c.suite_hiera_hierachy = [
'fqdn/%{fqdn}.yaml',
'os/%{os.family}/%{os.release.major}.yaml',
'os/%{os.family}.yaml',
'common.yaml',
{
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',
},
]
end
```
Expand Down
20 changes: 16 additions & 4 deletions lib/voxpupuli/acceptance/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,22 @@ def configure_beaker(modules: :metadata, &block)
c.add_setting :suite_hiera, default: true
c.add_setting :suite_hiera_data_dir, default: File.join('spec', 'acceptance', 'hieradata')
c.add_setting :suite_hiera_hierachy, default: [
'fqdn/%{fqdn}.yaml',
'os/%{os.family}/%{os.release.major}.yaml',
'os/%{os.family}.yaml',
'common.yaml',
{
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',
},
]

# Node setup
Expand Down
2 changes: 1 addition & 1 deletion voxpupuli-acceptance.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'bcrypt_pbkdf', '~> 1.1'
s.add_runtime_dependency 'beaker', '>= 4.33', '< 6'
s.add_runtime_dependency 'beaker-docker', '~> 2.1'
s.add_runtime_dependency 'beaker-hiera', '~> 0.4'
s.add_runtime_dependency 'beaker-hiera', '~> 1.0'
s.add_runtime_dependency 'beaker-hostgenerator', '~> 2.2'
s.add_runtime_dependency 'beaker_puppet_helpers', '~> 1.0'
s.add_runtime_dependency 'beaker-rspec', '~> 8.0', '>= 8.0.1'
Expand Down

0 comments on commit d06c892

Please sign in to comment.