voxpupuli / onceover

Your gateway drug to automated infrastructure testing with Puppet
Apache License 2.0
142 stars 45 forks source link

Onceover dies with a Hiera 5 #92

Closed fuero closed 7 years ago

fuero commented 7 years ago

Onceover dies with a Hiera 5 file:

  42) role::test using fact set CentOS-7.0-64 should compile into a catalogue without dependency cycles
      Failure/Error: it { should compile }
        error during compilation: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'profile::test::plain' failed: DataBinding 'hiera': v4 hiera.yaml is only to be used inside an environment or a module and cannot be given to the global hiera at /xxx/.onceover/etc/puppetlabs/code/environments/production/site/role/manifests/test.pp:2:3 on node xxx
      # ./spec/classes/role__test_on_CentOS-7.0-64_spec.rb:7:in `block (3 levels) in <top (required)>'
dylanratcliffe commented 7 years ago

What does you hiera.yaml look like? I've got it working in my repo: https://github.com/dylanratcliffe/puppet_controlrepo/blob/production/hiera.yaml

dylanratcliffe commented 7 years ago

The error looks like it's encountering a v4 yaml file but it might just be cryptic

fuero commented 7 years ago

I figured it out - This happens with Puppet 4.8.x, using current 4.10.x fixes the issue.

dylanratcliffe commented 7 years ago

Weird... Let me know if you find a more specific bug, I'll close for now