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/

2
  • 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. Commented Apr 6, 2015 at 20:36
  • 1
    I agree about seeing the output. Plus it may help to followup with an issue on the module source itself. Commented Apr 7, 2015 at 15:02

1 Answer 1

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

1
  • Thank you. I tested it and if I explicitly order all my resources, this problem disappears. Commented Apr 7, 2015 at 18:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.