puppetlabs / ruby-pwsh

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

Optional parameter not working with pwshlib 1.2.0 #340

Closed ic248 closed 2 months ago

ic248 commented 2 months ago

Describe the Bug

Upgraded puppetlabs-pwshlib from 1.1.1 to 1.2.0 and this has caused dsc_webapplication to fail with the following error

Error: /Stage[main]/Website::testapp/iis::Webapp[WebAppName]/Dsc_webapplication[WebAppName]: Could not evaluate: Provider returned data that does not match the Type Schema for `dsc_webapplication[WebAppName]`
Value type mismatch:
    * dsc_sslflags:  (expects a value of type Undef or Array, got String)

Looking at the documentation for dsc_webapplication (below) in webadministrationdsc it stated that dsc_sslflags is optional.

https://forge.puppet.com/modules/dsc/webadministrationdsc/reference#dsc_sslflags

I've raised this here since the only change I made was upgrading pwshlib and the version of webadministrationdsc we have installed (4.1.0-0-3) states it supported pwshlib (>= 0.9.0 < 2.0.0). I've updated webadministrationdsc from 4.1.0-0-3 to the latest (4.2.0-0-0) but it still errors out.

Expected Behavior

I shouldn't need to specify the optional parameter.

Steps to Reproduce

Manifest

    dsc_webapppool {
        'WebAppName'
            dsc_ensure => 'Present',
            dsc_name => 'WebAppName',
            dsc_state => 'Started',
            dsc_autostart => true,
            dsc_identitytype => 'ApplicationPoolIdentity',
            dsc_startmode => 'AlwaysRunning',
            dsc_maxprocesses => 1,
            require => Dsc_windowsfeature['iis'],
            validation_mode => 'resource';
    }
    dsc_webapplication {
        'WebAppName':
            dsc_ensure => 'Present',
            dsc_website => 'servera.example.com',
            dsc_name => 'WebAppName',
            dsc_physicalpath => 'c:\www\',
            dsc_webapppool => 'WebAppName',
            validation_mode => 'resource';
    }

Environment

Additional Context

I put the issue in here and not in webadministrationdsc since it seems to be an issue with how Puppet is handling the parameters

jordanbreen28 commented 2 months ago

Thanks for raising @ic248, we tracked the root cause and have reverted. v1.2.1 should now work again.

ic248 commented 2 months ago

thanks @jordanbreen28 can confirm 1.2.1 has now fixed the issue