Hi Oliver,

Nice catch! Thanks for posting your patch.

Cheers,

Adam

On Friday, November 30, 2012 9:27:05 AM UTC-6, r0k5t4r wrote:
>
> Hi Adam,
>
> The class 
> Win32_OperatingSystem<http://msdn.microsoft.com/en-us/library/aa394239%28VS.85%29.aspx>exists
>  on Vista and above. For older systems you can use 
> Win32_ComputerSystem<http://msdn.microsoft.com/en-us/library/aa394102%28VS.85%29.aspx>.
>  
> I found this information here:
>
>
> http://www.adminarsenal.com/admin-arsenal-blog/bid/19689/Determining-OS-Architecture
>
> The following minor change did the trick for windows 2003.
>
> Facter.add(:os_architecture) do
>   confine :operatingsystem => :windows
>   setcode do
>     result = ''
>     require 'win32ole'
>     wmi = WIN32OLE.connect('winmgmts://./root/CIMV2')
>         winver = Facter.value('kernelmajversion')
>         case winver
>         when /5.2|5.1|5.0/
>                 query = wmi.ExecQuery('select SystemType from 
> Win32_ComputerSystem')
>                 query.each do |os|
>                         result = os.SystemType
>                         break
>                 end
>                 if result == "X86-based PC"
>                         result = "32-bit"
>                 else
>                         result = "64-bit"
>                 end
>                 result
>         else
>                 query = wmi.ExecQuery('select OSArchitecture from 
> Win32_OperatingSystem')
>                 query.each do |os|
>                         result = os.OSArchitecture
>                         break
>                 end
>     result
>         end
>   end
> end
>
> Have a nice weekend.
>
>
> On Friday, November 30, 2012 2:16:11 PM UTC+1, r0k5t4r wrote:
>>
>> Hi Adam,
>>
>> thanks a lot. I have successfully implemented your or_architecture fact 
>> on our machines. But it looks like it is not workung under Windows 2003 
>> 32Bit.I have to check this...
>>
>> Regards,
>> Oli
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/7upl5eoH0d8J.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to