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

DSC - dsc_xadgroup resource does not appear to be idempotent

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: dsc
    • Labels:
    • Environment:
    • Template:
    • Epic Link:
    • Team:
      Modules
    • CS Priority:
      Reviewed

      Description

      I am testing the use of the xadgroup dsc resource with puppet. In order to get access to the resource I had to use the master branch of the dsc repo on github; it's not available in the version on the forge.

      When the code is processed the first time and the group does not exist the system creates the AD group as expected. When a subsequent run is kicked off the resource generates an error indicating the specified group already exists. I expected the resource to be idempotent and not attempt to create an existing ADgroup.

      I am able to reproduce this on multiple machines for both 2008 R2 and 2012 R2.


      Error: The specified group already exists
      Error: /Stage[main]/Profile::Windows::Dsc_createad/Dsc_xadgroup[LSA-DSC-TESTING]/ensure: change from absent to present
      failed: The specified group already exists

      Code to create an AD group (removed identifying variables)

      class profile::windows::dsc_createad {
       
        $create_adgroup=hiera('create_adgroup')
       
        # Create an ADgroup
        dsc_xadgroup {'LSA-DSC-TESTING':
          dsc_ensure           => 'Present',
          dsc_groupname        => 'LSA-DSC-TESTING',
          dsc_category         => 'Security',
          dsc_groupscope       => 'Global',
          dsc_path             => <OU removed>,
          dsc_description      => "<puppet managed> ${::hostname} Users",
          dsc_domaincontroller => <dc removed>,
          dsc_credential       => {
            'user'     => <user removed>,
            'password' => "${create_adgroup}"
          }
        }
      }
      

      Update made to puppetfile in feature branch to pull in branch with xadgroup resource

      mod 'dsc',
        :git => 'https://github.com/puppetlabs/puppetlabs-dsc',
        :ref => 'master'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mark.davenport2@stjoe.org Mark Davenport
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Zendesk Support