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

ENC-enforced environment makes `puppet lookup` environment simulation difficult

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • PUP 4.9.4
    • PUP 7.13.0, PUP 6.26.0
    • None
    • Hide

      If the --environment flag is used then puppet lookup should always use that environment regardless of what the ENC says. If the environment doesn't exist locally then it should error since we don't have the necessary per-environment hiera configuration and data.

      When the "--compile" flag is omitted, then this "accidentally works" due to the change made in PUP-8502. Once lookup defaults to the ENC environment (in PUP-8094) then it will cause this issue to "regress" when the "--compile" flag is specified. So this ticket is to make sure "--environment" works consistent with or without "--compile" and is blocked on PUP-8094

      Show
      If the --environment flag is used then puppet lookup should always use that environment regardless of what the ENC says. If the environment doesn't exist locally then it should error since we don't have the necessary per-environment hiera configuration and data. When the "--compile" flag is omitted, then this "accidentally works" due to the change made in PUP-8502 . Once lookup defaults to the ENC environment (in PUP-8094 ) then it will cause this issue to "regress" when the "--compile" flag is specified. So this ticket is to make sure "--environment" works consistent with or without "--compile" and is blocked on PUP-8094
    • Night's Watch
    • 5
    • NW - 2021-11-17, NW - 2021-12-06
    • Major
    • 3 - 25-50% of Customers
    • 3 - Serious
    • 5 - $$$$$$
    • Hide
      `puppet lookup` is a great tool for helping understand what hiera is doing. Improving it by adding the ability for the user to specify the environment would make it even better and reduce this one point of friction.

      Usability/intuitiveness is an area we need to improve on as we've gotten a lot of user feedback. Improving this would help reduce user surprise.
      Show
      `puppet lookup` is a great tool for helping understand what hiera is doing. Improving it by adding the ability for the user to specify the environment would make it even better and reduce this one point of friction. Usability/intuitiveness is an area we need to improve on as we've gotten a lot of user feedback. Improving this would help reduce user surprise.
    • Enhancement
    • Changed the priority of the `--environment` option by skipping the classification whenever the flag is specified. This allows the user to bypass the ENC enforced environment with the CLI option.
    • Automate
    • could be automated in an integration test in rspec

    Description

      The use case here is that we're trying to move people away from using the hiera binary to simulate/debug lookups to using puppet lookup. With hiera you could pass environment variables that matched whatever "variables" were in hiera.yaml to simulate what Puppet would provide, so doing: hiera testkey environment=test would allow us to simulate this lookup in the test environment.

      When we tried doing that with: puppet lookup testkey – environment test we found that we were still getting values from the production environment. This is because puppet lookup (even without using --compile) will pull down a node object for whatever node is being targeted, and that means it's going through paths of indirection and ultimately the ENC. If the ENC is enforcing an environment, then puppet lookup is bound to that environment. In our case above (using the Console), setting the node to a nodegroup enforcing "Agent-specified environment" allowed us to simulate a lookup in another environment properly.

      I'm marking this as an "Improvement" instead of a bug, but the reality is that it's a pretty major use-ability issue because being able to simulate lookups decoupled from the ENC is a pretty common exercise for people debugging Hiera data.

      Attachments

        Issue Links

          Activity

            People

              victor.bobosila Victor Bobosila
              gary Gary Larizza
              Votes:
              5 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support