Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7170

puppet 4.9.0 breaks existing hiera config

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Do
    • Affects Version/s: PUP 4.9.0
    • Fix Version/s: PUP 4.9.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Centos7, Puppet 4.9.0 (puppet-agent 1.9.0), AIO

    • Template:
    • Acceptance Criteria:
      Hide

      Alias lookup should work as until 4.8.1

      Show
      Alias lookup should work as until 4.8.1
    • Team:
      Puppet Developer Experience
    • Sprint:
      AP 2017-02-08
    • Zendesk Ticket IDs:
      32483
    • Zendesk Ticket Count:
      1
    • QA Risk Assessment:
      No Action

      Description

      Hiera alias de-referencing is broken in puppet 4.9.0 in Puppet 4.8.1. it was still working correctly.

      Error:

      Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'mymodule::confighash' failed: 'alias' interpolation is only permitted if the expression is equal to the entire string at /tmp/config/modules/mymodule/manifests/init.pp:3:10 on node testnode
      

      Puppet 4.9.0:

      [root@SERVER config]# puppet apply --modulepath modules/ --hiera_config=hiera.yaml -e "include mymodule" --certname testnode
      Warning: The function 'hiera_hash' is deprecated in favor of using 'lookup'. See https://docs.puppet.com/puppet/4.9.0/reference/deprecated_language.html
         (file & line not available)
      Warning: /tmp/config/hiera.yaml: Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5
         (in /tmp/config/hiera.yaml)
      Error: Evaluation Error: Error while evaluating a Function Call, Lookup of key 'mymodule::confighash' failed: 'alias' interpolation is only permitted if the expression is equal to the entire string at /tmp/config/modules/mymodule/manifests/init.pp:3:10 on node testnode
      

      Puppet 4.8.1:

      [root@SERVER config]# puppet apply --modulepath modules/ --hiera_config=hiera.yaml -e "include mymodule" --certname testnode
      Notice: Scope(Class[Mymodule]): {key => {value => xxx/config.cfg}}
      Notice: Compiled catalog for testnode in environment production in 0.09 seconds
      Notice: Applied catalog in 0.14 seconds
      

      How to reproduce:

      .
      ├── hiera
      │   ├── certname
      │   │   └── testnode.yaml
      │   └── common.yaml
      ├── hiera.yaml
      └── modules
          └── mymodule
              └── manifests
                  └── init.pp
      

      Hiera Config:

      ---
      :backends:
        - yaml
       
      :hierarchy:
        - "certname/%{::clientcert}"
        - "common"
       
      :yaml:
        :datadir: ./hiera
      

      Hiera certname layer:

      # file: hiera/certname/testnode.yaml
      ---
      mymodule::myparam: "xxx"
      

      Hiera common ayer:

      # file: hiera/common.yaml
      ---
      mymodule::confighash:
        key:
          value: "%{alias('mymodule::myparam')}/config.cfg"
      

      Puppet class:

      # file: modules/mymodule/manifests/init.pp
      class mymodule (
      ) {
        notice(hiera_hash('mymodule::confighash',{}))
      }
      

      Run puppet:

      puppet apply --modulepath modules/ --hiera_config=hiera.yaml -e "include mymodule" --certname testnode
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              elconas Robert Heinzmann
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support