Why hiera-puppet-hepler not able to find the variable? [closed]

asked 2014-08-29 03:38:52 -0600

Manish gravatar image

I am trying to follow an example given here,https://github.com/bobtfish/hiera-puppet-helper.

I could get the hieradata example working fine, however not able to heiraconfig.

Here is my test (spec/classes/init_spec.rb) code...

describe "kp_ls" do
let(:node) { 'testhost.example.com' }

let(:hiera_config) do
    { :backends => ['yaml'],
        :hierarchy => [
         :yaml => {
             :datadir => File.expand_path(File.join(__FILE__, '..', '..', 'hieradata')) }}

#let(:hiera_data) { { :foo_message => "bar" } }

it { should contain_notify("foo1").with_message("bar") }

My directory structure looks as follows


I tried various combinations of yaml files by moudle name, hostname name, but every time the test fails with,

  1) kp_ls
     Failure/Error: it { should contain_notify("foo1").with_message("bar") }
       Could not find data item foo_message in any Hiera data file and no default supplied at /opt/source/t3_git/config/puppet/baseconf/modules/kp_ls/spec/fixtures/modules/kp_ls/manifests/init.pp:11 on node testhost.example.com
     # ./spec/classes/init_spec.rb:26:in `block (2 levels) in <top (required)>'

Am I missing something obvious?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by binford2k
close date 2018-07-23 23:48:27.304356


I made some progress. When I specific %{fqdn}/%{fqdn} it is able to find the path correctly. But not with calling_module.

Manish gravatar imageManish ( 2014-08-29 04:33:30 -0600 )edit

I couldn't get hiera_data to work either. Did you have to do anything to make it work?

Chams gravatar imageChams ( 2015-10-30 12:34:08 -0600 )edit