puppetlabs / ruby-pwsh

A ruby gem for interacting with PowerShell
MIT License
15 stars 23 forks source link

Add parameter 'dsc_source' back to dsc_windowsfeature #212

Closed JCW-USDA closed 10 months ago

JCW-USDA commented 1 year ago

Describe the Bug

Within the deprecated PuppetLabs DSC, dsc_windowsfeature the parameter 'dsc_source' existed. When applying the same code with PSDscResources, the parameter is not available, thus preventing the ability to assign a source for the feature.

Expected Behavior

The ability to assign a source when attempting to add a feature for a node that does not have access to the default source.

Steps to Reproduce

1 - Use deprecated DSC module in environment. 2 - Apply code within a manifest. Example: dsc_windowsfeature{'Web-Net-Ext': dsc_ensure => 'Present', dsc_name => 'Web-Net-Ext', dsc_source => 'c:/Temp/Sources/Server2019_SXS/sxs', } 3 - Validate with a puppet run. 4 - Working 5 - Change module to PSDSCRourcess 6 - Apply the same code in step 2. 7 - Validate with a puppet run. 8 - Fail with the following error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: no parameter named 'dsc_source' (file: manifests/init.pp, line: 183) on Dsc_windowsfeature[Web-Net-Ext]

Environment

jordanbreen28 commented 10 months ago

hey @JCW-USDA unfortunately we only support the wrapper of the DSC module (ruby-pwsh and puppet.dsc). The source parameter is not a valid paramter for the WindowsFeature of the PSDscResources DSC module, and thus is not picked up by puppet in the generation of the puppetized module.

Essentially, we offer a way to run the DSC module through puppet, and as there is no source parameter on the windows feature dsc resource (see here), there is also no source type parameter available to puppet.

Thank you for raising this with us.