xPSDesiredStateConfiguration
xPSDesiredStateConfiguration copied to clipboard
In dsc_xservice while specifying the runsAsAccount thorough dsc_credentials getting warning about dsc_builtinaccount.
Problem description
When I pass invoke a dsc_xservice resource using below puppet code
**dsc_xservice { $service_item:
dsc_name => $service_setting[dsc_name],
dsc_desktopinteract => $service_setting[dsc_desktopinteract],
dsc_state => $service_setting[dsc_state],
dsc_startuptype => $service_setting[dsc_startuptype],
dsc_credential => {
'user' => "${root_domain}\\${service_setting[dsc_credential][user]}",
'password' => Sensitive($service_user_pw),
},
}**
I get an warning like below
**Provider returned data that does not match the Type Schema for dsc_xservice[SetSqlServerAgentServiceUser]
Value type mismatch:
- dsc_builtinaccount: smartplantcloud\KMT03-DBS-001-SQLAGT (expects an undef value or a match for Enum['LocalService', 'LocalSystem', 'NetworkService', 'localservice', 'localsystem', 'networkservice'], got 'smartplantcloud\KMT03-DBS-001-SQLAGT')** And the resource is always showing up as a corrective change from running to ignored, this was working with the module puppetlabs-dsc
Verbose logs
N/A
DSC configuration
dsc_xservice { $service_item:
dsc_name => $service_setting[dsc_name],
dsc_desktopinteract => $service_setting[dsc_desktopinteract],
dsc_state => $service_setting[dsc_state],
dsc_startuptype => $service_setting[dsc_startuptype],
dsc_credential => {
'user' => "${root_domain}\\${service_setting[dsc_credential][user]}",
'password' => Sensitive($service_user_pw),
},
}
Suggested solution
N/A
Operating system the target node is running
N/A
PowerShell version and build the target node is running
N/A
xPSDesiredStateConfiguration version
9.1.0-0-4
@johlju, @Indhukrishna, @KarolKaczmarek after mentioning validation_mode as 'resource' we are able to prevent the resource from registering as a corrective change but still not able to resolve the warning issue. Could I get some help here.
Not sure there is an issue with the resource, are you sure the error is coming from the resource? Suggest you debug the resource to see where in the code the error is thrown.
I'm experiencing same issue with 9.1.0-0-8, where I have a custom domain account running the service and get dsc_builtinaccount: [email protected] (expects an undef value or a match for Enum['LocalService', 'LocalSystem', 'NetworkService', 'localservice', 'localsystem', 'networkservice'], got '[email protected]')
I'm not specifying dsc_credential, but have the custom domain account setup as the run-as manually.
This must be an issue in Puppet - it seems to return an error for the parameter BuiltInAccount in both cases above, and I'm guessing neither of you have added that parameter? So guessing the problem is in the Puppet's translation of "Puppet configuration" to the code running the resource.
I think this is an external issue that we can't resolve in this repo. Please comment if you find an actual issue with the resource's code.