From 650b6428205de4a01d6de0fd5e71881b7cfec7a0 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Fri, 3 Nov 2023 18:18:32 +0100 Subject: [PATCH] Use beaker-hiera 1.x with hiera.yaml version 5 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. --- README.md | 20 +++++++++++++++---- .../acceptance/spec_helper_acceptance.rb | 20 +++++++++++++++---- voxpupuli-acceptance.gemspec | 2 +- 3 files changed, 33 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 4b03def..83872a3 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/lib/voxpupuli/acceptance/spec_helper_acceptance.rb b/lib/voxpupuli/acceptance/spec_helper_acceptance.rb index 9e5a393..f7b327f 100644 --- a/lib/voxpupuli/acceptance/spec_helper_acceptance.rb +++ b/lib/voxpupuli/acceptance/spec_helper_acceptance.rb @@ -81,10 +81,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/%{networking.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 diff --git a/voxpupuli-acceptance.gemspec b/voxpupuli-acceptance.gemspec index 684e6b4..5cd89bb 100644 --- a/voxpupuli-acceptance.gemspec +++ b/voxpupuli-acceptance.gemspec @@ -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'