-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dsc resources parameters should be case insensitive #254
Comments
Hi @Clebam. Thanks for submitting this issue. To help me replicate this on my Windows test server, can you please include some sample code? If relevant, could you send some code snippets:
What Windows version are you running the above on? Many thanks, |
Hi @gavindidrichsen, This would fail
This would run (notice both 'Present' and 'Started' and 'Integrated' were upcased)
Running on windows 2019 (but would be similar on other version) The whole issue is linked to the fact that upon conversion from .ps1 file to puppet resource, the casing of Enum is preserved. |
I can find this comment that concerns this issue : https://github.com/puppetlabs/ruby-pwsh/blob/main/lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb#L86 Edit : Found this PR : #131 It seems to purposefully exclude enum from matching insensitively. Is there a good reason for this ? Thanks |
I learned about Though, it updates each params when one of them is changed. (that is the expected behavior of validation_mode) I wonder if the issue still needs to stay opened of if the definitive answer to this type of problems is the |
Well it appears validation_mode slows down a lot the resource. I experience the casing issue on every resource (for instance for
|
Hi, there is one thing I would like to figure out.
Therefore I really think it may be something from my environment. But I would like some confirmation that it does work as intented for everyone. I tried to dig for a few days in my env without finding anything that would explain the issue I'm facing. But if I have the confirmation it definitely should work, I'll keep digging. (For now, I don't know if it's a bug, a feature or my env 😓) |
@Clebam thanks for raising this. Closing as per discussion https://puppetcommunity.slack.com/archives/CFD8Z9A4T/p1696342031154069. Root cause was use of the deprecated and unmaintained dsc_xWebAdministration module, which has problems in the underlying dsc module code. Use of the favoured dsc_webadministrationdsc module resolved this issue. Action items are on us to update the badging of these modules on the forge ASAP to reflect their status. Thanks again! |
Also we have problems updating iis site certificates. (Creating sites works perfectly) In previous versions (Server 2016 and Puppet 6), it works perfectly, but now in Server 2022 and Puppet 8, it is not working. We are using dsc-webadministrationdsc (v4.1.0-0-5). The following code is the one causing the error upon execution:
if we edit this file /etc/puppetlabs/code/environments/production/modules/webadministrationdsc/lib/puppet/type/dsc_website.rb and modify this line:
and in the enum we add 'MY' it works perfectly. |
Describe the Bug
Here is an error message I have from DSC
Error: Failed to apply catalog: Parameter dsc_ensure failed on Dsc_xwebapppool[test_site.fr]: dsc_xwebapppool.dsc_ensure expects an undef value or a match for Enum['Absent', 'Present'], got 'present'
We can see the resource fails to apply because the enum expects a capitalized Present
Expected Behavior
The casing should not matter.
Whether 'present' or 'Present' is provided should be accepted.
At least when dealing with enforced values (like Enum)
Steps to Reproduce
Steps to reproduce the behavior:
Set ensure: present (all downcased)
Environment
Additional Context
The text was updated successfully, but these errors were encountered: