Skip to content
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.yaml is not created for each environment #230

Open
ilvidel opened this issue Aug 22, 2018 · 1 comment
Open

hiera.yaml is not created for each environment #230

ilvidel opened this issue Aug 22, 2018 · 1 comment

Comments

@ilvidel
Copy link

ilvidel commented Aug 22, 2018

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.3
  • Ruby: 2.0.0
  • Distribution: CentOS Linux 7
  • Module version: 3.3.2

How to reproduce (e.g Puppet code you use)

  class { 'hiera':
    hiera_version    => '5',
    hiera5_defaults  => {
      'datadir' => 'data',
      'data_hash' => 'yaml_data'
    },

    # EYAML
    create_keys      => true,
    eyaml            => true,
    keysdir          => '/etc/puppetlabs/puppet/keys/',

    # GLOBAL HIERARCHY
    hierarchy        => [
      {
        'name'       => 'Secrets and passwords',
        'lookup_key' => 'eyaml_lookup_key', # eyaml backend
        'path'       => 'secure.eyaml',
        'options'    => {
          'pkcs7_private_key' => '/etc/puppetlabs/puppet/keys/private_key.pkcs7.pem',
          'pkcs7_public_key'  => '/etc/puppetlabs/puppet/keys/public_key.pkcs7.pem'
        }
      },
      {
        'name'       => 'Node-specific config',
        'data_hash'  => 'yaml_data', # Standard yaml backend
        'path'       => 'nodes/%{::fqdn}.yaml'
      },
      {
        'name'       => 'Default yaml file',
        'data_hash'  => 'yaml_data', # Standard yaml backend
        'path'       => 'common.yaml'
      }
    ]
  }

What are you seeing

The module creates /etc/puppetlabs/puppet/hiera.yaml correctly, but puppet lookup doesn't find the keys. I need to copy/link that file into /etc/puppetlabs/code/environments/*/hiera.yaml for puppet to be able to find the keys and work properly.

What behaviour did you expect instead

The module should create the hiera.yaml file in the environments directories

Output log

This is the message when environment/hiera.yaml does not exist:

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Function lookup() did not find a value for the name 'nagios::slack_channel::devel' on node nagios-test.build.nonlive.bcc

Any additional information you'd like to impart

N/A

@ZeroPointEnergy
Copy link
Contributor

The puppet module manages the global hiera.yaml which is in /etc/puppetlabs/puppet/ . Puppet should still read this except if you have set hiera_config to something else in the puppet.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants