msutter DSC模块(PowerShell Defined State Configuration)似乎有一个瓶颈。 每个使用DSC资源的类都会生成中间的Powershell / DSC代码,在同一个目录中创build一个名为current.mof的文件。 当我运行Puppet代理 – testing事情变得棘手。 似乎一个傀儡class正在获得与不同傀儡class有关的信息,就好像它产生了MOF,然后偶然地执行了另一个class的MOF。 我想我可以find一种方法来链接所有这些资源与依赖性箭头,以便他们顺序执行,但这意味着我不能真正单独的configuration文件类为每个ZIP档案我开箱。 我更喜欢一个服务器得到类A,B和C,另一个得到B,C等。如果我把链接,那么我必须复制大量的代码。
我正确的吗? 我是PowerShell的新手。 下面是一个从Web服务中提取ZIP文件并将其解压缩到目标位置的类的示例:
# 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" } }
注:这是交叉发布: http : //ask.puppetlabs.com/question/16423/is-the-file-currentmof-a-bottleneck-when-using-the-dsc-module/
这听起来像一个错误。 你可能想在这里提交一个问题https://github.com/msutter/puppet-dsc
更新:我在https://github.com/msutter/puppet-dsc/issues/1提交了一个问题