voxpupuli/puppet-hiera

mapped_paths is not recognized

Opened this issue · 1 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.2.0
  • Ruby: 2.5.3p105
  • Distribution: Red Hat Enterprise Linux Server release 7.6
  • Module version: 3.3.4

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

hiera::hierarchy:
  - name: 'role'
    lookup_key: 'eyaml_lookup_key'
    mapped_paths:
      - 'roles'
      - 'role'
      - "hieradata/%{environment}/role/%{literal('%')}{role}.yaml"
    options:
      pkcs7_private_key: /etc/puppetlabs/puppet/keys/private_key.pkcs7.pem
      pkcs7_public_key:  /etc/puppetlabs/puppet/keys/public_key.pkcs7.pem

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, ${hierarchy} should be an array of hash (file: /etc/puppetlabs/code/environments/master/modules/hiera/manifests/init.pp, line: 251, column: 15) on node

What behaviour did you expect instead

Expected hiera.yaml to be generated like so:

hierarchy:
  - name: "role"
    mapped_paths:
      - roles
      - role
      - "hieradata/master/role/%{role}.yaml"

as described in https://puppet.com/docs/puppet/5.0/hiera_config_yaml_5.html#the-hierarchy-key

Output log

Any additional information you'd like to impart

I am having the same issue, created a PR( #285 ), however I am not sure if anything else is required. Tested locally and it worked