2

The msutter DSC module (PowerShell Defined State Configuration) seems to have a bottleneck. Every class that uses a DSC resource generates intermediate Powershell/DSC code that creates a file called current.mof in the same directory. When I run Puppet agent --test things go screwy. It seems like one puppet class is getting information related to a different puppet class, as if it generates its MOF and then executes a different class' MOF by accident. I suppose I can find a way to chain all these resource together with dependency arrows so that they are executed serially, but then that means I can't have truly separate profile classes for each ZIP archive I am unpacking. I would prefer for one server to get classes A, B, and C, another gets B, C, etc. If I put the chaining in, then I have to duplicate a lot of code.

Am I correct about this? I am very new to PowerShell. Here is an example of a single class that pulls a ZIP file from a Web Service and then unzips it into the target location:

# This profile class installs the BookingsUI package from a URI specified in the global ::package_source variable
class phoenix_profiles::archive_test {
  $archive_file        = "BookingsUI.zip"
  $drive               = pick($::destination_drive, 'd:')
  # $staged_archive_path = "${drive}/eftours/packages/${archive_file}"
  $staged_archive_path = "${drive}/temp/puppet_archive_test/source/${archive_file}"
  dsc_xremotefile { "download ${archive_file}":
    dsc_uri => "${::package_source}/${archive_file}",
    dsc_destinationpath => $staged_archive_path
  } ->
  dsc_archive { "unpack ${archive_file}":
    dsc_ensure      => 'Present',
    dsc_validate    => "true",
    dsc_checksum    => "ModifiedDate",
    dsc_force       => "true",
    dsc_path        => $staged_archive_path,
    dsc_destination => "${drive}/temp/puppet_archive_test/BookingsUI"
  }
}

NOTE: This is cross-posted from: http://ask.puppetlabs.com/question/16423/is-the-file-currentmof-a-bottleneck-when-using-the-dsc-module/

  • 1
    Can you give us any of the output from when things "go screwy?" I for one would like to see what you're describing about executing the wrong MOF. – jbsmith Apr 6 '15 at 20:36
  • 1
    I agree about seeing the output. Plus it may help to followup with an issue on the module source itself. – ferventcoder Apr 7 '15 at 15:02
1

This sounds like a bug. You may want to file an issue here https://github.com/msutter/puppet-dsc

Update: I filed an issue at https://github.com/msutter/puppet-dsc/issues/1

  • Thank you. I tested it and if I explicitly order all my resources, this problem disappears. – Paul Chernoch Apr 7 '15 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.