PowerShell DSC Resources
Desired State Configuration (DSC) is a configuration framework in PowerShell that enables you to manage your infrastructure with configuration as code.
Managing DSC resources with Puppet
Puppetfile
and deployed it to your code base, you can declare
the DSC resources. For example, if you deploy the dsc-xinternetexplorerhomepage
module, you declare the resources in your Puppet code
like this:dsc_xinternetexplorerhomepage { 'homepage':
dsc_ensure => 'Present',
dsc_startpage => 'https://puppet.com',
}
The dsc-xexchange module allows you to manage an entire MS Exchange server using resource types and parameters for configuration.
You can find all of the PowerShell DSC modules on the Forge.
Install them and use them like you would any other Puppet module. You can find the parameter
documentation on the References tab of each module's Forge page (or via puppet describe). If the module author did not fully
document the DSC resource, the Forge might only
include a list of parameters and valid data types. For more information, you can
click the Project URL link at the top of the module page to see the documentation
source repository. Note that each parameter of the original DSC resource starts with
dsc_
when used with Puppet.
Puppet’s support policy for PowerShell DSC modules
The PowerShell DSC modules are different from other modules on the Forge. DSC Modules are auto-generated and mostly consist of vendored code that is not owned by Puppet. While Puppet supports the modules, it does not support the vendored DSC content inside the module. This support policy means that:
-
Puppet supports the translation layer between Puppet and DSC.
-
Puppet supports the build of the auto-generated modules, including private modules.
-
Puppet ensures that the tool accurately converts PowerShell modules with DSC Resources into Puppet modules.
-
Puppet does not provide support for bugs or features of PowerShell modules and their DSC Resources. If you pass the correct values to DSC but the resource is failing or behaving unexpectedly, report the issue to the DSC maintainers.
-
Convert private DSC Resources to a Puppet module
If you have private DSC resources, you can convert them to a Puppet module. -
Distributing arbitrary DSC resources
You can use thepuppetlabs-dsc_lite
module to manage target nodes with arbitrary DSC resources. -
Upgrading Puppet DSC modules
ThePuppet.dsc
PowerShell module is the third Puppet DSC module. Thepuppetlabs-dsc
module is now deprecated and thepuppetlabs-dsc_lite
module is for advanced use cases only. To upgrade to thePuppet.dsc
module, follow the upgrading instructions below. -
Troubleshooting DSC Resources
Use this guide to troubleshoot issues with Puppet code containing DSC resources.