I worked it out - here's the solution for anyone who might stumble across 
this:

In spec/spec_helper.rb:

require 
'fixtures/modules/module_data/lib/hiera/backend/module_data_backend.rb'RSpec.configure
 do |c|
  c.hiera_config = File.join('spec', 'fixtures', 'hiera', 'hiera.yaml')end


In spec/fixtures/hiera/hiera.yaml:

---:backends:
  - module_data


And make sure the module is installed to the path 
fixtures/modules/module_data, or if not then adjust accordingly.
On Tuesday, 26 August 2014 13:49:35 UTC-4, [email protected] wrote:
>
> Hi all,
>
> I have a module I'm trying to convert from params.pp to 
> ripienaar/module_data. I've got to the point where I can run Puppet with:
>
>     puppet apply --debug --noop --hiera_config 
> spec/fixtures/hiera/hiera.yaml --modulepath spec/fixtures/modules -e 
> 'include ...'
>
> and can see from the hiera debug messages that module_data is active and 
> is pulling info from the data directory based on the hierarchy specified in 
> data/hiera.yaml. However, in rspec-puppet parameters from module_data 
> aren't getting passed through and I've run out of ideas as to why. Here's 
> the setup that I had hoped would get things going:
>
> *spec/fixtures/hiera/hiera.yaml:*
> ---
> :backends:
>   - module_data
>
> *spec/spec_helper.rb:*
> require 'puppetlabs_spec_helper/module_spec_helper'
>
> RSpec.configure do |c|
>   c.hiera_config = File.join('spec', 'fixtures', 'hiera', 'hiera.yaml')
> end
>
>
> *.fixtures.yaml:*fixtures:
>   symlinks:
>     module_name: "#{source_dir}"
>   forge_modules:
>     module_data: "ripienaar/module_data"
>
> Does anyone have an idea as to why this isn't working? Is this even 
> expected to work like this with rspec-puppet right now? I'm using 
> rspec-puppet 1.0.1, puppetlabs_spec_helper 0.8.1 and Puppet 3.6.2.
>
> Thanks in advance for any help!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2083ef95-52cf-48d8-87d0-857042010ecb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to