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

puppet lookup -E doesn't execute the ENC

    XMLWordPrintable

Details

    • RHEL 7 (x86_64)
    • Hide

      It should be possible to set a node parameter in an external node classifier, reference that node parameter in hiera.yaml and ensure the value is resolved correctly when running "puppet lookup -E <env>" for the current node, for a different node and with/without the --compile option. If "-E" is omitted, then it should default to the environment specified in puppet.conf or default to "production"

      By default, it should be possible to interpolate the "environment" parameter in hiera. However, if an explicit environment is specified (via -E) then it should take precedence over what the ENC returned.

      Show
      It should be possible to set a node parameter in an external node classifier, reference that node parameter in hiera.yaml and ensure the value is resolved correctly when running "puppet lookup -E <env>" for the current node, for a different node and with/without the --compile option. If "-E" is omitted, then it should default to the environment specified in puppet.conf or default to "production" By default, it should be possible to interpolate the "environment" parameter in hiera. However, if an explicit environment is specified (via -E) then it should take precedence over what the ENC returned.
    • Phoenix
    • 3
    • Phoenix 2022-11-09, Phoenix 2022-11-23
    • Needs Assessment
    • Known Issue
    • Hide
       The issue is if you specify puppet lookup with an explicit environment ( '--environment web' ) then lookup will not call to the classifier, causing any node parameters set in the classifier to be omitted. The reason for the behavior is because if we call the classifier, then the classifier will by default assign a different environment to the node, returning a lookup result for a different environment than was requested. See PUP-7479

      No work around - Unfortunately it doesn't work when specifying an explicit environment ( 'puppet lookup --environment' ), a node parameter is defined in the classifier and your hiera.conf interpolates the node parameter, e.g. 'data/%{::tier}.yaml'

      It also affects open source (replace the word 'classifier' with 'ENC')
      Show
       The issue is if you specify puppet lookup with an explicit environment ( '--environment web' ) then lookup will not call to the classifier, causing any node parameters set in the classifier to be omitted. The reason for the behavior is because if we call the classifier, then the classifier will by default assign a different environment to the node, returning a lookup result for a different environment than was requested. See PUP-7479 No work around - Unfortunately it doesn't work when specifying an explicit environment ( 'puppet lookup --environment' ), a node parameter is defined in the classifier and your hiera.conf interpolates the node parameter, e.g. 'data/%{::tier}.yaml' It also affects open source (replace the word 'classifier' with 'ENC')
    • Needs Assessment

    Description

      Puppet Version: 6.27.0 (should be 6.27.1 but puppet -V shows an 'unreleased' version 6.27.0)
      Puppet Server Version: 6.19.0
      OS Name/Version: RHEL7

       puppet lookup --compile --node `hostname -f` -E production somevalue

      Doesn't execute the ENC at all. So all variables that are defined via the ENC's parameters are not available. Oddly enough '-E production' fails too. Not providing '-E production' (so it defaults to the production environment) does execute the ENC.

       

      Desired Behavior:

       puppet lookup -E <environment> --compile

       should execute the ENC.

      Actual Behavior:

      ENC is never executed (and its values aren't passed). Even with '-E production'. It does work without -E. But this makes it impossible to check hiera in a dev environment. Some of our modules are depending on variables that are set via the ENC. Code just fails to compile because all of the ENC's information is missing.

       

      Attachments

        Issue Links

          Activity

            People

              aria.li Aria Li
              SirDice Remko Catersels
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support