PowerShell / DscResources

Central repository for PowerShell Desired State Configuration (DSC) resources.
http://blogs.msdn.com/b/powershell/
MIT License
777 stars 204 forks source link

Confirm Behavior of Puppet/Chef using DSC Resources with Get missing MOF parameters #510

Open PlagueHO opened 5 years ago

PlagueHO commented 5 years ago

Puppet and Chef can use DSC Resources. However, they use them in a different way to the DSC LCM. It would be good to confirm if Puppet/Chef has any issues with resources when the input parameters in Get-TargetResource differ from the MOF.

This is to confirm that this style guideline will not cause any problems for Puppet/Chef users of the DSC resource kit.

indented-automation commented 5 years ago

Puppet does not call Get-TargetResource at all. Both the dsc and dsc_lite modules use Invoke-DscResource to call Test and Set.

The dsc module parses the mof file on build to establish which parameters should be replayed into a puppet type definition.

I personally can't see a reason why the style guideline would cause a problem for Puppet.

jpogran commented 5 years ago

Hi, Puppet employee here, primary contributor to the puppetlabs-dsc and puppetlabs-dsc_lite modules. As @indented-automation said, we use Invoke-DscResource to call the Test and Set methods directly, as those map to our workflow the best. You can see an example here and here. We do not use the Get methods as Puppet tracks state differently than DSC does.

What would make things difficult for us if the parameter sets for each of the functions are different. In the puppetlabs-dsc module we rely on parsing existing MOF files to build Puppet types. If there are significant differences in parameter sets, we could have problems determining which to include. This is less of a problem in the puppetlabs-dsc_lite module, as we leave it up to the user to specify which parameters to include.

PlagueHO commented 5 years ago

Thanks @jpogran ! Appreciate the response and the detail + links. Now we just need to find out from the team at Chef. Hopefully it is the same situation. I'm not really considering Ansible here, but perhaps we should?