Uploaded image for project: 'Puppet Agent'
  1. Puppet Agent
  2. PA-286

Windows MSI should not put an environment setting in puppet.conf by default

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: puppet-agent 1.3.6
    • Fix Version/s: puppet-agent 1.5.0
    • Component/s: Windows
    • Labels:
      None
    • Template:
    • Sub-team:
    • Story Points:
      2
    • Sprint:
      RE 2016-04-27, RE 2016-05-04, RE 2016-05-11

      Description

      The Puppet Agent MSI package on Windows puts environment=production in puppet.conf by default even if PUPPET_AGENT_ENVIRONMENT is left out during installation time.

      The affect of that is that the $agent_specified_environment fact will always have a value, and will never be undef. This ultimately breaks the commonly used agent-specified environment workflow described here: https://docs.puppet.com/pe/latest/console_classes_groups_environment_override.html#workflow

      On *nix Puppet agent installations, the environment key is left out of puppet.conf. During a Puppet run, the agent will still request the production environment by default and the $agent_specified_environment fact is left undefined.


      The commit here notes that this behavior was intentional.


      On a fresh install, I tried to set PUPPET_AGENT_ENVIRONMENT to the empty string during installation time, but that resulted in no change. environment=production still made it into puppet.conf


      It would be ideal if the Puppet Agent behaved the same on Windows and *nix platforms. This way, special exceptions would not need to be made in Puppet code or in the Node Classifier.

      What I ended up doing to account for this difference was put a rule in my agent-specified node group of 'agent_specified_environment' is not 'production'. That, combined with the recommended 'agent_specified_environment' matches regex '^.+', ended up giving me the desired outcome.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sean.mcdonald Sean McDonald
              Reporter:
              nate.mccurdy Nate McCurdy
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support