Closed norbertstoll closed 2 years ago
@norbertstoll have you tried running with the validation_mode
flag set to resource
per this documentation?
Looking at the source code for the resource, it looks like the only mandatory property is the NewName
property (see below); because of the API surface of DSC and how Puppet has to interact with it, Puppet can't make assumptions about properties and parameters for edge cases, which this seems to be hitting.
@michaeltlombardi I already tried this but forgot to mention. Sorry!
Adding validation_mode
sadly didn't change the behaviour (though it helped a lot in the past regarding securitypolicydsc)
@norbertstoll For this specific issue, I think the only short term solution might be to use puppetlabs/dsc_lite
- this is a case where an optional parameter changes the underlying behavior in a way that is not predictably reported by the DSC Resource's API; for the autogenerator (and thereby, the base provider in this repo) to handle the behavior, there would need to be some sort of flag on the DSC Resource property which indicates that it should be passed to Get
if specified; as-is, there's no way to distinguish this from any other optional parameter.
@michaeltlombardi Understood. I'll try via _dsclite. Thanks anyway :)
No problem!
Describe the Bug
It's impossible to rename a network adapter if there's more than one network adapter installed.
It doesn't make any difference if I add the MacAddresses, the InterfaceIndexes, the InterfaceNumbers or whatever - it will always fail as long as there's more than one NIC installed.
Seems like there's an issue with the parameter 'IgnoreMultipleMatchingAdapters' within NetworkingDsc's NetAdapterName.
Expected Behavior
Adapters, independent of the total amount of NICs, are being renamed as defined.
Steps to Reproduce
puppet agent -t
:2.1 Output of a puppet run with only one network adapter installed: ('Ethernet0' is renamed successfully, 'Ethernet1' fails because it doesn't exist yet - fine.)
2.2 Output of a puppet run with a second network adapter installed:
Environment
puppet agent 6.24.0 mod 'puppetlabs-pwshlib', '0.10.1' mod 'dsc-networkingdsc', '8.2.0-0-3'
Additional Context
The error can not be reproduced via PowerShell DSC in its native way.