Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-2243

Move DSC LCM RefreshMode changes out of invoke_dsc_resource

    XMLWordPrintable

Details

    • Improvement
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • None
    • None
    • None
    • 3
    • Windows 2015-07-29, Windows 2015-08-12

    Description

      Puppet and DSC are idempotent systems that generally follow the rule: change one thing, only once, if not in the desired state.

      In our implementation of invoke_dsc_resource we change several things all at once:

      1. Create a symlink if not present
      2. Change LCM RefreshMode to Disabled if not already set
      3. Invoke DSC Resource
      4. Change LCM RefreshMode back to original state if it was not already set to Disabled

      With the exception of the Invoke DSC Resource step, all of the other are 'setup' steps that are one and done type things. They change the state of the system to allow use to run DSC using Puppet. These steps should be moved to the module installation point, put into a manifest that Puppet needs to run, or made required steps the user must make in the readme.

      If at any point any of these 'setup' steps fail, the failure is not in DSC Resource but in the setup step. It complicates our code and confuses the user. We're changing more than one thing, but saying we are only changing one thing. If we keep the LCM change inside this step, this means its changed for every DSC Resource we invoke, potentially dozens of times back and forth. It is unknown if this will cause problems.

      I propose we should check RefreshMode at the begining of the run and bail if it is not Disabled and make a manifest to test and set the RefreshMode that is included in our module.

      Attachments

        Issue Links

          Activity

            People

              ryan.gard Ryan Gard
              james.pogran James Pogran
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support