Yep, a custom fact. In case someone else happens upon this looking for a 
similar answer, here's my custom fact to override Facter's default path 
fact:

Facter.add('path') do
  confine :kernel => 'windows'
  setcode do
   my_fact = Facter::Util::Resolution.exec('C:\Windows\system32\cmd.exe /C 
"reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session 
Manager\Environment" /v Path""')
   my_fact.rpartition('REG_EXPAND_SZ').slice(2).strip
  end
end

Thanks Rob !


On Thursday, July 17, 2014 3:37:03 PM UTC-4, Jim Richard wrote:
>
> Facter on a Windows 2008R2 server is doing something weird. Version of 
> facter is 2.0.2.
>
> If I, from the Puppet command prompt, do a "echo %Path%", I see exactly 
> what I expect. But if I say "facter Path", it shows me all of the Puppet 
> added path stuff twice, ie. the output is almost twice as much text.
>
> Oddly, the original pre: puppet agent install path data is still reported 
> by facter, correctly, not doubled up, but all of the path items added by 
> the puppet agent install process show up twice when I issue a "facter 
> Path". 
>
> My "real" path:
>
>
> E:\oracle\product\11.2.0\db_1\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Unix;E:\oracle\product\11.2.0\db_1\OPatch;C:\jdk_release\bin;F:\RATEWARE
>
> What facter thinks is my Path:
>
> C:\Program Files (x86)\Puppet Labs\Puppet\puppet\bin;C:\Program Files 
> (x86)\Puppet Labs\Puppet\facter\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\hiera\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\sys\ruby\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\sys\tools\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\puppet\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\facter\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\hiera\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\bin;C:\Program Files (x86)\Puppet 
> Labs\Puppet\sys\ruby\bin;C:\ProgramFiles(x86)\PuppetLabs\Puppet\sys\tools\bin;E:\oracle\product\11.2.0\db_1\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Unix;E:\oracle\product\11.2.0\db_1\OPatch;C:\jdk_release\bin;F:\RATEWARE
>
>
> Any ideas what might cause this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a244e99f-3c11-4052-a0d4-f491089a1764%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to