-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hiera_config
doesn't override puppet 5 layer 3 hiera.yaml
#626
Comments
+1 |
@LongLiveCHIEF Can you create a simple repo with failing tests that show your expected behavior here? I had a look at the repo you provided in the linked issue but there were no failing tests in there. I'm not entirely sure what you're trying to do here (hiera 5 is a very different beast to hiera 3) and some failing examples will clarify things for me :) |
I added the following to module Puppet
class Pops::Lookup::ModuleDataProvider
def configuration_path(lookup_invocation)
pr = provider_root(lookup_invocation)
pr.join('spec').find do |path|
if path.basename.to_s.eql?(Puppet::Pops::Lookup::HieraConfig::CONFIG_FILE_NAME)
return path
end
end
pr + Puppet::Pops::Lookup::HieraConfig::CONFIG_FILE_NAME
end
end
end If you'd rather use one module Puppet
class Pops::Lookup::ModuleDataProvider
def configuration_path(lookup_invocation)
Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', 'hiera.yaml')))
end
end
end @rodjek I'm not sure if @LongLiveCHIEF is experiencing the exact same issue as me, but when I run into trouble is when a module listed in |
As of puppet 5, hiera is now native to puppet. When a module as
hiera.yaml
at it's root, it's given precedence over any values passed in yourspec/spec_helper.rb
forhiera_config
.As an example, my module's
hiera.yaml
hierarchy contains a eyaml data source. This has caused some issues (documented here) which I tried to get around by providing rspec-puppet a different hiera.yaml file to use for testing, that didn't contain the eyaml data sources.Unfortunately, it appears that even though this value is passed, it doesn't trump the layer 3 hiera specification of the module's own
hiera.yaml
file. Even though i've confirmed that rspec-puppet loads the config file specified in myspec/spec_helper.rb
, it does not use values from the data sources in that configs hierarchy. It uses the data-sources defined in the module's ownhiera.yaml
file.Is there a way we can ensure that the following overrides the layer 3
hiera.yaml
file in puppet 5 modules?The text was updated successfully, but these errors were encountered: