Skip to content

Commit

Permalink
NEWOPS-1083 Look in the right place.
Browse files Browse the repository at this point in the history
The old code was actually relying on a global aged Hiera 3 configuration that Mat had deliberately left lying around in `/etc/puppetlabs/puppet/hiera.yaml`. This is liable to stop working at some point so let's just read the options from the environment's default options.
  • Loading branch information
halfninja committed Jun 10, 2024
1 parent 5bdb295 commit 975e875
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/puppet/functions/eyaml_tools/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ def ensure_config
unless @config_done
c = hiera_config
raise Puppet::ParseError, 'no Hiera config found' unless c
eyaml_config = c[:eyaml]
raise 'no :eyaml section found in Hiera config' unless eyaml_config
eyaml_config = c['defaults']['options']
raise 'no defaults.options section found in Hiera config' unless eyaml_config
eyaml_config.each do |key, value|
Puppet.debug "EyamlTools: setting #{key} to #{value}"
Hiera::Backend::Eyaml::Options[key] = value
Hiera::Backend::Eyaml::Options[key.to_sym] = value
end
@config_done = true
end
Expand Down

0 comments on commit 975e875

Please sign in to comment.