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

hiera lookup regression in resource like class definitions with undef parameter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.3.0, PUP 4.3.1
    • Fix Version/s: PUP 4.3.2
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-12-16, Language 2015-12-30
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      This fixes a regression issue where a hiera lookup for a class parameter did not happen if the parameter value was set to {{undef}} in the resource declaration.

      Description

      Another regression with hiera lookups if classes are defined resource like and a parameter is configured undef. With prior versions a hiera lookup happened for this parameter. With 4.3.x no lookup occurs. Short reproducer:

      • hiera.yaml:

        ---
        :backends:
          - yaml
         
        :hierarchy:
          - global
         
        :yaml:
          :datadir: "/etc/puppetlabs/code/hiera"
        

      • /etc/puppetlabs/code/hiera/global.yaml:

        test::p: 'hiera value'
        

      • test module: /etc/puppetlabs/code/modules/test/manifests/init.pp:

        class test (
          $p = 'default module value',
        ) {
          notice($p)
        }
        

      with puppet 4.3.1:

      puppet apply --hiera_config [..]/hiera.yaml --modulepath=/etc/puppetlabs/code/modules -e 'class { "test": p => undef }'
      Notice: Scope(Class[Test]): default module value
      Notice: Compiled catalog for puppet4.3.1 in environment production in 0.10 seconds
      

      with puppet 4.2.3:

      puppet apply --hiera_config [..]/hiera.yaml --modulepath=/etc/puppetlabs/code/modules -e 'class { "test": p => undef }'
      Notice: Scope(Class[Test]): hiera value
      Notice: Compiled catalog for puppet4.2.3 in environment production in 0.65 seconds
      

      And an example were this happens in the wild is the module jfryman-nginx with the parameter migration from init.pp to config.pp (an example parameter is server_tokens among others).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                john.duarte John Duarte
                Reporter:
                vicinus Reinhard Vicinus
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support