puppetlabs-stdlib
puppetlabs-stdlib copied to clipboard
facter: do not use dummy package instantiation on windows
can you explain why you propose this change?
I believe (still reviewing) that this dummy package instantiation is causing excessive delays when run over a winrm connection. The answer is always 'windows' as I don't believe you can change the package provider on windows before facter runs. Here is what I see using facter -p --timing: fact 'package_provider', took: (16.278307) seconds when every other fact is sub-second.
not sure if I put this in the right spot. https://tickets.puppetlabs.com/browse/PUP-11647?filter=-2
maybe it is worth investigating why ot takes so long (if that is always the cas). I know that many people use chololatey on windows, but I am not sure if people set that as default provider.
you can't set the default provider to chocolatey before puppet runs. If you set Package {provider=chocolatey} that occurs after facter. so I am not sure what this fact accomplishes on windows. Personally i think the fact is a bit 'dumb', as it only confirms what puppet already knew.
that is not completly true. A custom provider, like the chocolety one, could overwrite the default provider that puppet core sets. and the initial purpose of this was to figure out which provider will be used, and not what the usual default provider for the platform is.
custom provider, like the chocolety one, could overwrite the default provider that puppet core sets.
Can you substantiate that? If that is the case, I will abandon this effort.
Hi @rismoney - as you have noted, a custom provider cannot override the default. It can claim to be default and then Puppet will "randomly" choose one and warn you about it.
Unfortunately, there seems to be test failures for this PR - could you look to resolve them and then rebase with the current main so we can proceed? :-)
Hi @rismoney, As there has been no movement on this PR since October 4th, I will proceed to close this request. Once you have the bandwidth to pick this back up again, and review the comments above, please do re-open this request and we can think about proceeding! Thanks for your continued hard work on this!