Merge pull request #22 from zyv/fix_spec

Fix the SPEC file (COPYING no longer shipped, README -> README.md)
(#8964) Search mountinfo for selinux mount point

In order to support existing systems which mount selinuxfs under
'/selinux' and those that do not -- starting with Fedora 16 the selinuxfs
will be mounted under '/sys/fs/selinux' -- this patch changes the
selinux mount point from a static value of '/selinux' to the results
returned from searching '/proc/self/mountinfo'.
Merge pull request #23 from adrienthebo/maint/master/remove_domain_global_variable

(maint) Remove global var from domain and hostname
Merge pull request #26 from adrienthebo/maint/master/remove_domain_global_variable

(maint) Add stubbing and corrections for domain spec
Merge pull request #27 from khightower/ticket/master/8964

(#8964) Search mountinfo for selinux mount point
(#8964) Search mountinfo for selinux mount point

Fix up code that fails when you don't have the SELinux mountpoint available.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Merge pull request #16 from egh/master

fix for #8148
(#8439) Add Facter::Util::WMI module

This commit adds a WMI module with methods for connecting to the WMI
service and executing queries. This code is based on Nick's ASDI
module in puppet, but only contains the WMI calls that we need. As
part of this change, it ensures the default WMI moniker string is
consistently specified as the following:

  winmgmts:{impersonationLevel=impersonate}!//./root/cimv2

However, the wmi_resource_uri method can be overridden to provide
different behavior if necessary, e.g. different WMI namespace.

This commit also refactors the various places that we were using WMI
(inconsistently). Another motivation for this change is to allow the
WIN32OLE.connect and ExecQuery methods to be stubbed, which wasn't
possible previously.

This commit also adds manufacturer spec tests for Windows, which stub
the connect and execquery methods so that the tests can be run on
non-Windows platforms.
(#8439) Implement total and free physical memory on Windows

This commit adds the 'memoryfree' and 'memorytotal' facts for Windows.
These values represent the amount of physical free and total memory
respectively. Note that the free and total values come from different
WMI objects that report memory sizes in different units. The free
value reported by Win32_OperatingSystem is in kB whereas the total
value as reported by Win32_ComputerSystem is in bytes.

This commit does not add facts for free and total page sizes, since
the total page size is associated with the Win32_PageFileSetting
class, but WMI reports no instance(s) available when automatic page
file management is enabled (and it is by default).
(#8439) Add physicalprocessorcount and processor facts on Windows

This commit adds the 'physicalprocessorcount', 'processor{n}' and
'processorcount' facts. The 'physicalprocessorcount' fact is obtained
by counting the number of Win32_Processor instances. Note that the WMI
query does a select on just the Name property, because it is faster
than doing a 'select *'

On Windows 2008, each Win32_Processor represents a physical processor,
and the NumberOfLogicalProcessors property (which includes both multi
and/or hyperthreaded cores) represents the number of logical
processors. For example, a dual-core processor, with quad-hyper
threads per core, will report 1 physical processor and 8 logical
processors.

Note that the NumberOfCores property could be used to distinguish
between multi-core and hyperthreading processors, but the fact does
not distinguish between them.

On Windows 2003, each Win32_Processor represents a logical processor,
and the NumberOfLogicalProcessors property is not available. In this
case, the physicalprocessorcount fact will be over-reported, but the
number of logical processors will be correct.

With that said, if this hotfix is installed, then 2003 behaves like
2008:

  http://support.microsoft.com/kb/932370

The Win32_Processor.Name property contains extra spaces:

  Intel(R) Core(TM) i7 CPU       M 620  @ 2.67GHz

So we 'squeeze' the output to eliminate duplicate spaces:

  processor0 => Intel(R) Core(TM) i7 CPU M 620 @ 2.67GHz
(#9183) Add support for Alpine linux detection

Adds support for Alpine Linux operatingsystem and operatingsystemrelease
facts, by relying on the presence and contents of /etc/alpine-release.

Thanks to Jon Auer for this patch.

Signed-off-by: Adrien Thebo <adrien@puppetlabs.com>
Merge pull request #33 from adrienthebo/ticket/master/9183-add_alpine_linux_detection

(#9183) Add support for Alpine linux detection
(#7682) Add complete support for Scientific Linux

Provides for more complete coverage for Scientific Linux facts.

Signed-off-by: Adrien Thebo <adrien@puppetlabs.com>
(#8439) Move macaddress resolution on Windows

Moved the code for performing macaddress resolution into a utility
module.  This is being done in preparation for supporting
interface-specific macaddresses, e.g. macaddress_<ifname> = <mac>.

As before, the 'macaddress' fact returns the macaddress of the first
network adapter on which IP is enabled, which is the same behavior on
other platforms.

Previously, the fact was selecting all properties, but only retrieving
the MACAddress property. This commit changes the query to only select
the property it needs, which reduces the amount of data obtained from
WMI.
(#8439) Add ps fact on Windows

The ps fact was defaulting to 'ps -ef', which isn't valid on
Windows. This commit adds a Windows-specific ps fact that returns the
output of tasklist. This executable is available in XP and later.
(#8439) Add ipaddress6 fact on Windows

This commit adds the ipaddress6 fact, which is determined using
netsh. Note that the command uses the SYSTEMROOT environment variable
to handle hosts that have non-standard windows directories.

The fact follows other platforms in that it returns the first
non-loopback (::1) and non-linklocal (fe80.*) ipv6 address.
(#8439) Add interface-specific ip facts for Windows

This commit adds Windows to the list of Facter::Util::IP
'supported_platforms'

It adds support for the 'interfaces' fact, e.g.

  interfaces =>
  Loopback_Pseudo_Interface_1,Local_Area_Connection,Teredo_Tunneling_Pseudo_Interface

On Windows, the name of the interface can be edited to include
non-alphanumeric characters, which are not valid fact names. This
commit changes the alphafy method to ensure the returned value only
includes alphanumeric characters (and underscore).

And the ipaddress, netmask, network, and ipaddress6 per-interface
facts, e.g.

  ipaddress_local_area_connection => 172.16.138.218
  netmask_local_area_connection => 255.255.255.0
  network_local_area_connection => 172.16.138.0

  ipaddress6_teredo_tunneling_pseudo_interface =>
  2001:0:4137:9e76:24de:36a7:53ef:7525

Note the per-interface macaddress fact is not yet supported.

Also these facts are only supported on 2008, because the output and
syntax of netsh is different on 2003. Also 2003 has dependencies on
the Routing and Remote Access service, which may not be running.
Merge remote-tracking branch 'josh/ticket/master/8439-basic-facter-on-windows'

* josh/ticket/master/8439-basic-facter-on-windows:
  (#8439) Add interface-specific ip facts for Windows
  (#8439) Add ipaddress6 fact on Windows
  (#8439) Add ps fact on Windows
  (#8439) Move macaddress resolution on Windows
  (#8439) Add physicalprocessorcount and processor facts on Windows
  (#8439) Implement total and free physical memory on Windows
  (#8439) Add Facter::Util::WMI module
(#9059) is_virtual should be false on vmware_server

VMWare server is returned as the value of the virtual fact, but is a
hypervisor. Improved the checking for physical hosts in the is_virtual
fact.
(#7957) is_virtual should be false for openvz host nodes

Added the value 'openvzhn' to the list of virtual types that are
actually physical. Updated tests to reflect the difference between
virtual environments and host nodes.

Thanks to Dan Carley for this patch.

Signed-off-by: Adrien Thebo <adrien@puppetlabs.com>