-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
Problem Statement
As we continue to make DSC more viable cross-platform, we have a serious problem with MOF. MOF parsing is provided by MMI.dll (there is both native code and managed code). MMI itself has dependency on OpenSSL 1.0 for the WSMan features. The non-Windows build of MMI is no longer supported and has been deprecated.
Proposal
To enable DSC resources to work cross-platform and on new distros that have moved to OpenSSL 1.1 (which is not backwards compatible with 1.0), we need to move away from MOF schema. This also means we would only support DSC resources written as PowerShell script (Get, Set, Test functions) or PowerShell classes. PowerShell classes already don't require a MOF schema, but many DSC Resources are script resources so we need to move to something other than MOF to describe the schema of that resource.
The current proposal is to move to JSON instead of MOF.
Engine Changes
System.Management.Automation.dll needs to be updated to understand JSON schema instead of MOF schema for PowerShell script DSC resources.
[NOTE!] Compilation of DSC configuration to MOF will not change for now, but in the future we also want to have configuration compile to a JSON format instead of MOF.
PSDesiredStateConfiguration module
This module exists outside of this repo. Plan is to eventually make it Open Source. For now, changes will need to be made to this module to work with JSON schema instead of MOF. In addition, it should expose a new cmdlet to help convert existing MOF schema to the new JSON schema format for existing DSC PowerShell script resources.
With this change, embedded objects passed to Get/Set/Test will be PSObjects instead of CimInstances. Unless the script is explicitly checking that it is a CimInstance, existing code should work with PSObject.
Also, a new Test-DscResourceSchema cmdlet will be added to validate the script resource matches the JSON schema.
What about LCM (Local Configuration Manager) and WindowsPowerShell?
Building upon the work in PS7.0 to enable use of Invoke-DscResource, the current plan is to not integrate with WindowsPowerShell LCM. This means that new DSC Resources based on JSON will not be compatible with WindowsPowerShell. This also means that existing DSC Resources that are WMI/OMI based or only have MOF schema will not be supported.