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/