Description
Ruby and Puppet currently call CoInitialize and OleInitialize, which setup single-threaded apartments (STA, or COINIT_APARTMENTTHREADED) on Windows. This is incompatible with COINIT_MULTITHREADED (MTA), which is the only supported option on Nano Server.
On Nano Server, CoInitializeEx returns an error if you try to initialize with STA. CoInitialize and OleInitialize appear to do something special to continue working there, but https://bugs.ruby-lang.org/issues/12371 may result in changing to explicitly using MTA in Ruby.
Update Leatherman's WMI setup to fallback to MTA when STA fails. If COM was previously initialized, we still proceed as if CoInitializeEx succeeded; we support this two-tier attempt so that we'll use whichever Ruby and Puppet will end up using (as Facter may be initialized first). This will likely need to change again if Ruby/Puppet change how they initialize COM.
Attachments
Issue Links
- relates to
-
FACT-1418 Remove COM moniker usage / support to be able to support Nano Server
-
- Resolved
-