Skip to content

Commit

Permalink
Convert to Hiera 5
Browse files Browse the repository at this point in the history
Until now the deprecated Hiera 3 config was deprecated. This rewrites it
to only generate Hiera 5 version.
  • Loading branch information
ekohl committed Nov 3, 2023
1 parent edabd69 commit 647b1a0
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/beaker-hiera/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,20 @@ module Hiera
# @param [Host, Array<Host>, String, Symbol] host
# One or more hosts to act upon, or a role (String or Symbol) that
# identifies one or more hosts.
# @param [Array] hierarchy
# One or more hierarchy paths
def write_hiera_config_on(host, hierarchy)
# @param [Array] paths
# One or more paths within the Hiera data directory
def write_hiera_config_on(host, paths)
block_on host do |hst|
hiera_config = {
backends: 'yaml',
yaml: {
version: 5,
defaults: {
datadir: hiera_datadir(hst),
data_hash: 'yaml_data',
},
hierarchy: {
name: 'Hiera data',
paths: paths,
},
hierarchy: hierarchy,
logger: 'console',
}
create_remote_file hst, hst.puppet['hiera_config'], hiera_config.to_yaml
end
Expand Down

0 comments on commit 647b1a0

Please sign in to comment.