-
Notifications
You must be signed in to change notification settings - Fork 32
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
Make output for group and provider resources in dsc config *
more readable
#266
Comments
It looks like the ask is that the provider is just a pass thru and doesn't have it's own wrapper result? As long as there isn't a scenario where a provider should have it's own properties, then that would make sense. |
Is there a case where a provider would have properties that are enforceable at the provider level? What would that look like? I think a provider can still have write-only properties to control its behavior, like a hypothetical |
Based on the discussion, it seems that the ask is to introduce a new GroupGetResult, GroupSetResult, and GroupTestResult schema which contains This means |
Proposed output from Full outputresults:
- name: PSDSC
type: DSC/PowerShellGroup
results:
- name: OpenSSH service
type: PsDesiredStateConfiguration/MSFT_ServiceResource
result:
desiredState:
name: sshd
state: running
actualState:
name: sshd
state: stopped
inDesiredState: false
differingProperties:
- state
- name: Administrator
type: PsDesiredStateConfiguration/MSFT_UserResource
result:
desiredState:
UserName: administrator
Ensure: Present
actualState:
UserName: administrator
Ensure: Present
inDesiredState: true
differingProperties: []
messages: []
hadErrors: false
inDesiredState: false
- name: current user registry
type: Microsoft.Windows/Registry
result:
desiredState:
keyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion
valueName: ProductName
_exist: true
actualState:
keyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion
valueName: ProductName
_exist: true
inDesiredState: true
differingProperties: []
messages: []
hadErrors: false
inDesiredState: false Single instance resultname: current user registry
type: Microsoft.Windows/Registry
result:
desiredState:
keyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion
valueName: ProductName
_exist: true
actualState:
keyPath: HKLM\Software\Microsoft\Windows NT\CurrentVersion
valueName: ProductName
_exist: true
inDesiredState: true
differingProperties: [] Group instance resultname: PSDSC
type: DSC/PowerShellGroup
results:
- name: OpenSSH service
type: PsDesiredStateConfiguration/MSFT_ServiceResource
result:
desiredState:
name: sshd
state: running
actualState:
name: sshd
state: stopped
inDesiredState: false
differingProperties:
- state
- name: Administrator
type: PsDesiredStateConfiguration/MSFT_UserResource
result:
desiredState:
UserName: administrator
Ensure: Present
actualState:
UserName: administrator
Ensure: Present
inDesiredState: true
differingProperties: []
messages: []
hadErrors: false
inDesiredState: false In this proposed output, the structure for the output of a group resource is the same as the previous structure for a full configuration. The structure for the output of a singular instance of a resource is the same as before. The output is functionally recursive, which is relatively straightforward to indicate with the JSON schema. |
When we address this, we'll be making a breaking change to the schema again, so it might be worth co-addressing this with #138, making the schema easier to map to the version(s) that support it. |
Summary of the new feature / enhancement
While inspecting the output for group and provider resources, I noticed that the output structure for those resources is very difficult to read.
Define a configuration that uses a group or provider resource.
Configuration document
Get the current state of the configuration.
Actual Output
Proposed Output
Test whether the configuration is in the desired state
dsc --input-file ./assertion.dsc.config.yaml config test
Actual Output
Proposed Output
Enforce the configuration to the desired state
dsc --input-file ./assertion.dsc.config.yaml config set
Actual Output
Proposed Output
Proposed technical implementation details (optional)
Currently, DSC treats group and provider resources, which definitionally declare an array of resource instances, the same as normal instances.
Options
result
property adhering to thedsc resource *
output schema for each group/provider instance, those instances should define theresults
property adhering to thedsc config *
output schemas. This would make it much easier to read and process the results.results
as a flat array, associating nested instances to their parent with aparentResource
orresourceGraphPath
property. Using the examples above, theos
resource instance would havemy assertions
as theparentResource
or something likemy assertions>os
forresourceGraphPath
.Option 1 requires DSC, users, and integrating tools to distinguish between group/provider resource instances and normal resource instances in the output, but leaves the data more walkable/comparable to the configuration document definition.
Option 2 ensures that the output is always the same structurally, but may require integrating tools to handle re-grouping instance results.
The text was updated successfully, but these errors were encountered: