Upgrading Puppet DSC modules

The Puppet.dsc PowerShell module is the third Puppet DSC module. The puppetlabs-dsc module is now deprecated and the puppetlabs-dsc_lite module is for advanced use cases only. To upgrade to the Puppet.dsc module, follow the upgrading instructions below.

Upgrade from the puppetlabs-dsc module

To upgrade from the puppetlabs-dsc module, do the following:

  1. Remove the puppetlabs-dsc module from your Puppetfile.
  2. Replace the puppetlabs-dsc module with declarations for each of the modules you want.
  3. Optional: To avoid any future code changes, pin the DSC modules to the versions that shipped in the latest release of puppetlabs-dsc. Note that a benefit of the new module is that you do not need to include every DSC resource.
  4. Choose only the resources you need from the following list and declare them in your Puppetfile:
    mod 'dsc-xdefender', '0.2.0-0-0'
    mod 'dsc-xdhcpserver', '2.0.0-0-0'
    mod 'dsc-xdisk', '1.0.0-0-0'
    mod 'dsc-xdismfeature', '1.3.0-0-0'
    mod 'dsc-xdnsserver', '1.11.0-0-0'
    mod 'dsc-xexchange', '1.27.0-0-0'
    mod 'dsc-xfailovercluster', '1.12.0-0-0'
    mod 'ddsc-xhyper_v', '3.16.0-0-0'
    mod 'dsc-xinternetexplorerhomepage', '1.0.0-0-0'
    mod 'dsc-xjea', '0.2.16-6-0'
    mod 'dsc-xmysql', '2.1.0-0-0'
    mod 'dsc-xpendingreboot', '0.4.0-0-0'
    mod 'dsc-xphp', '1.2.0-0-0'
    mod 'dsc-xpowershellexecutionpolicy', '3.1.0-0-0'
    mod 'dsc-xpsdesiredstateconfiguration', '8.5.0-0-0'
    mod 'dsc-xremotedesktopadmin', '1.1.0-0-0'
    mod 'dsc-xremotedesktopsessionhost', '1.8.0-0-0'
    mod 'dsc-xrobocopy', '2.0.0-0-0'
    mod 'dsc-xscdpm', '1.2.0-0-0'
    mod 'dsc-xscom', '1.3.3-0-0'
    mod 'dsc-xscsma', '2.0.0-0-0'
    mod 'dsc-xscspf', '1.3.1-0-0'
    mod 'dsc-xscsr', '1.3.0-0-0'
    mod 'dsc-xscvmm', '1.2.4-0-0'
    mod 'dsc-xsmbshare', '2.1.0-0-0'
    mod 'dsc-xsqlps', '1.4.0-0-0'
    mod 'dsc-xtimezone', '1.8.0-0-0'
    mod 'dsc-xwebadministration', '2.5.0-0-0'
    mod 'dsc-xwebdeploy', '1.2.0-0-0'
    mod 'dsc-xwindowseventforwarding', '1.0.0-0-0'
    mod 'dsc-xwindowsrestore', '1.0.0-0-0'
    mod 'dsc-xwindowsupdate', '2.7.0-0`0'
    mod 'dsc-xwineventlog', '1.2.0-0-0'
    mod 'dsc-xwordpress', '1.1.0-0-0'
    Note: The underlying DSC versions are likely to have changed — you can update the modules to the latest versions one at a time, while testing each change. No code changes are required, except for DSC updates.

Upgrade from the puppetlabs-dsc_lite module

To upgrade from the puppetlabs-dsc_lite module, do the following:

  1. Refactor your code base to declare the proper resources — dsc_<name of resource>. For example, change the following code:
    dsc {'Download WebContent Zip':
      resource_name => 'XRemoteFile',
      module        => 'PSDesiredStateConfiguration',
      properties    => {
        ensure          => 'present',
        destinationpath => $zipfile,
        uri             => $zipuri,
      }
    }

    To look like this:

    dsc_xremotefile {'Download WebContent Zip':
      dsc_ensure          => 'present',
      dsc_destinationpath => $zipfile,
      dsc_uri             => $zipuri,
    }
  2. As you refactor each resource, add the required Puppet modules to your Puppetfile.
  3. After you remove the DSC Resources, remove the puppetlabs-dsc_lite module and turn off any automation that you are using to distribute DSC Resources.
  4. Test your code base.
    Note: The puppetlabs-dsc_lite module can coexist with the new DSC module.