Details
-
Task
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
-
Windows
-
1
-
Windows 2018-07-05, Windows 2018-07-11
-
Needs Assessment
Description
During MODULES-5970 it was found that the messages created when dsc_lite resources inaccurately report "created" when resources are created/removed/updated
Current behaviour:
Given a manifest of;
dsc {'FooFile':
|
dsc_resource_name => 'File',
|
dsc_resource_module => 'PSDesiredStateConfiguration',
|
dsc_resource_properties => {
|
ensure => 'present',
|
destinationpath => 'C:\\temp\\dscfile.txt',
|
contents => 'TestFile',
|
}
|
}
|
|
dsc {'FooFile2':
|
dsc_resource_name => 'File',
|
dsc_resource_module => 'PSDesiredStateConfiguration',
|
dsc_resource_properties => {
|
ensure => 'present',
|
destinationpath => 'C:\\temp\\dscfile2.txt',
|
contents => 'TestFile',
|
}
|
}
|
And the files C:\Temp\dscfile.txt and C:\Temp\dscfile2.txt already exist but with empty content
Puppet outputs;
...
|
Notice: Compiled catalog for glenn.sarti-c7s9ph2 in environment workstation_production in 9.23 seconds
|
Notice: /Stage[main]/Main/Dsc[FooFile]/ensure: created
|
Notice: /Stage[main]/Main/Dsc[FooFile2]/ensure: created
|
Notice: Applied catalog in 6.42 seconds
|
The "created" message is misleading / inaccurate in this case and should better reflect that we invoked a DSC resource, but don't know what it did. Doing this should require implementing the change_to_s method for the ensure property. See the https://github.com/puppetlabs/puppet/blob/5aef613f148ff19435cb48ab76c6b9b72b2d9143/lib/puppet/property/ensure.rb#L50-L64 definition.
Attachments
Issue Links
- is cloned by
-
MODULES-7360 dsc_lite: (SPIKE) Determine if Puppet can emit better change_to_s messages that include actual resource information
-
- Closed
-
- relates to
-
MODULES-5970 DSC_Lite : (SPIKE) Determine if generic `dsc` resource can report itself under a different resource name
-
- Resolved
-