Facter 1.6.5 Release Notes¶
EC2 Improvements¶
(#11566) Add windows support for ec2 facts¶
This patch adds support for detecting ec2 on windows. This works by modifying
the linux methodology by using arp -a instead of arp -an and searching for the
mac address with a hyphen delimiter (as apposed to a quote).
I've added tests and a sample fixtures which adds output from arp -a from a
windows machine and linux machines, on ec2 and not on ec2.
I've also re-worked the decision making into a util class so the testing is
much easier to write and work with, so now we can test the individual mechanism
for detecting that we are in a cloud on their own. This will be much better
abstracted into their own fact(s) but for now this has the least impact to
solve the problem at hand. In the future this logic (and tests) can certainly
be re-used if such a fact was evercreated.
Thanks to Feifei Jia <fjia@yottaa.com> for contributing the original code.
(#11196) Scan all arp entries for an ec2 mac¶
This patch now scans all arp entries for the magic EC2 mac address. At times
the mac entry was being returned out of order and since we only looked at the
first entry there were cases where the test would fail.
It also now removes the dependency on the arp fact which has become only
important to the EC2 fact anyway. This was to avoid hacking the arp fact
(which was obviously built for a different purpose) just to fix this issue.
(#8279) Join ec2 fact output with commas¶
ec2 facts were being concatenated, which made array data harder to use.
Switched to comma delimited data.
Thanks to Hunter Haugen <hunter@puppetlabs.com> for this patch.
Other Improvements¶
(#10271) Identifying ‘Amazon’ using ‘/etc/system-release’¶
Previously the operating system detection depended upon the lsbrelease package.
This wasn't guaranteed to be present, so this could lead to incorrect detection.
To remedy this, the presence of /etc/system-release is now used for detection
on amazon linux.
(#11436) Unify memorysize and memorytotal facts¶
Two different names were given for the amount of physical memory in a
given node. Switched to the name of 'memorysize' for the RAM and added a
fallback fact 'memorytotal' that reverts to the memorysize.
(#7753) Added error checking when adding resolves¶
Added exception handling to the fact class. When adding a resolution to
a fact, if an exception was thrown outside of the setcode block, facter
would crash. Added handling so that if an exception is thrown, facter
logs the error and discards the fact.
Facter 1.6.4 Release Notes¶
(#11041) Add dmidecode as a requirement for rpm¶
We were implicitly relying on dmidecode to determine certain facts
without being certain that it was installed. This change to the rpm
spec file will ensure we have dmidecode pulled in by rpm/yum as a
dependency and thus causing the correct functionality on facter.
Note this change only impacts EL based systems. The debian packaging is
handled in another repository.
(#10885) Malformed facter.bat when ruby dir contains backreferences¶
Previously, we were substituting occurrences of <ruby> and <command>
in the Windows batch wrapper scripts with the corresponding
paths. However,the gsub replacement string was not escaped, so if a
path contained something that looked like a backreference,
e.g. C:\ruby\187, the gsub would try to replace the backreference with
the corresponding capture group. Since there aren't any capture
groups, the backreference was stripped from resulting facter.bat,
resulting in an invalid path, C:\ruby87\bin\facter.
This commit eliminates the need for gsub, since paths can contain
other characters that have special meaning in a regexp, e.g. '.'.
It also writes the bat file in 'text' mode so that the resulting file
has '\r\n' line endings.
(#10444) Add identification of system boards to Facter¶
Facter 1.6.3 Release Notes¶
(#7038) Validate prtdiag output in manufacturer¶
prtdiag cannot be run inside zones, and calling
Facter::Util::Resolution.exec on it will return nil. The manufacturer
utility was calling split() on nil, which was raising an exception.
Added validation of prtdiag output, and simplified the regex to extract
values for facts. Added more coverage for the related facts as well.
(#10228) Ascendos OS support for various facts.¶
This patch will make various facts return the correct value on Ascendos
(a new RHEL rebuild - http://www.ascendos.org/):
* hardwareisa
* lsbmajdistrelease
* macaddress
* operatingsystem
* operatingsystemrelease
* osfamily
* uniqueid
(#10233) Adds support for Parallels Server Bare Metal to Facter¶
Facter 1.6.2 Release Notes¶
Maint: (#9555) Change all cases of tabs and 4 space indentation to 2 space indentation.¶
Since 2 space indentation seems to be Puppets (and the ruby communities)
standard this patch converts all incorrect indentation to 2 spaces.
The fact that we were mixing the indentation was causing people to mix them
within files - sometimes using 4 space, sometimes 2 space. This single change
makes it consistent across all the code.
New Fact: (#9830) Add sshecdsakey fact¶
From version 5.7 onward, openssh has support for elliptic curve DSA keys[1,2].
This commit adds a fact for those keytypes.
1 - http://openssh.org/txt/release-5.7
2 - http://tools.ietf.org/html/rfc5656
New Platform: (#9404) Add memory & update processor facts for DragonFly and OpenBSD.¶
Since there was no coverage for memory tests these have been added for
the two OS's.
Also since the mechanism for processor detection was changes this was
fixed for OpenBSD. A similar mechanism was added for the new DragonFly
BSD support.
Fix (#9404) De-clumsify CPU count detection and swap detection on OpenBSD.¶
As part of the DragonFly BSD work is was noticed that the OpenBSD
implementation could benefit from the same techniques so this commit
aligns that.
Fix (#6728) Improve openvz/cloudlinux detection.¶
Added more cloudlinux detection, which has /proc/lve/list present on
cloudlinux hosts. Removed a default value from openvz_type detection,
which could lead to a virtual value of "unknown" if the openvz check
partially failed, which could cause other legitimate virtual tests to
be skipped.
New Platform: (#7951) added OS support for Amazon Linux¶
Maint: (#9787) Change rspec format so we use the default, not document¶
Current running rake spec in facter means we get the document output which is
very verbose. Unfortunately we are forcing this in our .rspec file so you
can’t override it on a user by user basis with ~/.rspec for example.
I think we should not define —format, which means the default is progress
(which is less verbose and better for the average Joe and hacker who just
wants red light/green light) and then if people really want document format
they can override this in their own ~/.rspec file.
This way its the best of both worlds – more meaningful defaults and allowing
user overrides.
Fix (#7726) Silence prtconf error message inside zones¶
prtconf will output an error message when run inside a zone, which
clutters up facter output. Redirected the stderr to /dev/null.
Fix (#4980, #6470) Fix architecture in Darwin and Ubuntu¶
Architecture now relies on the hardwaremodel fact unless special cased
otherwise, such as for linux distributions that require amd64 as the
expected architecture. Ubuntu was added as a special case, OpenBSD was
collapsed into the current architecture fact and Darwin was added by
removing the kernel confine statement for the architecture fact.
New fact: (#6792) Added osfamily fact.¶
Added osfamily fact to determine if a given operating system is a
derivative of a common operating system.
Fix (#6515 and #2945) Fix processorcount for arm, sparc & ppc for linux.¶
Previously we were unable to check processor type and count on other
architectures for linux. This fix corrects that.
To remove complication from the fact we have moved the logic for parsing
cpuinfo and lsdev into their own static classes in Facter::Util::Processor.
This is to help with stubbing and to segregate that action as now we have
more conditional cases.
Tests and corresponding cpuinfo fixtures have been added to test those
alternative platforms as well.
Fix (#3856) Detect VirtualBox on Darwin as well as Linux and SunOS¶
Fix (#7996) Restrict solaris cpu processor detection¶
x86_64 based solaris machines have a pkg_core_id field in output of
kstat cpu_info, which denotes the core id of a specific core relative to
the cpu. This could cause misreporting of processor count. The regex to
count cores was restricted to prevent this. Additional x86_64 tests were
added to verify this behavior.
Fix (#7996) Add solaris processor facts¶
Adds processorcount and physicalprocessorcount facts for solaris.
Added minor whitespace change for physicalprocessorcount spec that
ccompanied adding a solaris section to the spec.
Thanks to Merritt Krakowitzer for his contributions to this patch.
Fix (#9295) Initial detection of Hyper-V hypervisor¶
pulled out from video card matching and dmidecode
Future plans include grabbing version info and seeing if module
is loaded.
dmidecode info:
System Information
Manufacturer: Microsoft Corporation
Product Name: Virtual Machine
Version: 7.0
Serial Number: ....-....-....-....-....-....-.. (removed)
UUID: ........-....-....-....-............ (removed)
Wake-up Type: Power Switch
Fix (#2747) Fix detection of xen0 vs xenu in Xen 3.2.¶
Check for xsd_kva for dom0, rather than independent_wallclock (which is present
on both dom0 and domu). Work around /proc/xen/capabilities, which is
sometimes not world-readable.
Facter 1.6.1 Release Notes¶
Fix physicalprocessorcount on windows¶
Fix #9517
A broken test led to a broken fact. The WMI.execquery was incorrectly stubbed
to return an array when the actual WMI.execquery does not return an array. This
means that length, which works on arrays, does not work with WMI.execquery.
This fixes both the fact and the test. The test is unfortunately lifted to a
higher level, but it has the benefit of being correct.
Thanks to Eric Stonfer for the fact fix.
Prevent repeated loading of fact files¶
Fix #8491
Fact loading could recurse indefinitely if a fact file attempted to call
Fact#value on a fact that was not yet defined before the current file.
If Fact#value was called outside of a setcode block, it would be
evaluated at load time and the loader would rescan the fact path from
the beginning and would reenter the current file, continuing until the
stack was full. This is a byproduct of the more exhaustive fact
searching introduced in 2255abee.
The resolution for this is to track the files that have been loaded and
ignore subsequent attempts to load them, emulating the behavior of
Kernel.require. However, since facts can be legitimately refreshed
over the life of a ruby process using Facter, Facter.clear will reset
the list of loaded files by destroying the fact collection, and
subsequently the loader.
Currently puppet agent will reload all facts preceeding a run, so normal
puppet agent behavior will remain as expected. However, the facter facts
terminus manually loads fact files itself and bypasses facter's search
path and standard loading mechanism. While it will benefit from the
recursion protection, it currently does not have a way to reset the
loaded file list.
Fix logic for domain fact so hostname, then dnsdomainname and finally resolv.conf is used.¶
Fix #9457
A recent commit changed the logic for how this fall-through logic was
working. I've fixed the logic and added more coverage to pick up on this.
Physical Memory on Windows¶
(#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).
Physical Processor Count for Windows¶
(#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
IP Facts for Windows¶
(#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.
Scientific Linux CERN Detection¶
Add Scientific Linux CERN detection to facter. Fixes #9260
Adds the SLC operatingsystem fact, and adds the SLC variant to all
locations that Scientific Linux is specified.
Added additional unit tests to verify that SLC would not be confused
with Scientific Linux.
CHANGELOG¶
3117e82 (#9517) Fix physicalprocessorcount on windows
4d93745 (#8491) Prevent repeated loading of fact files
6db71d4 (#9457) Fix logic for domain fact so hostname, then dnsdomainname and finally resolv.conf is used.
88f343c (#2344) VMware version parsing fix
6d47012 (#4869) Implement productname as Darwin hw.model
d28d96c (#4508) Xen HVM domU not detected as virtual
d55983e (#9178) Add Oracle Linux identification
ec04277 (#4228) Ensure MAC address octets have leading zeroes.
3eb3628 Add Scientific Linux CERN detection to facter. Fixes #9260
f810170 (#7957) is_virtual should be false for openvz host nodes
1414e0b (#9059) is_virtual should be false on vmware_server
7fb0e6a (#8439) Add interface-specific ip facts for Windows
5d5848c (#8439) Add ipaddress6 fact on Windows
7531a2b (#8439) Add ps fact on Windows
ddb67c5 (#8439) Move macaddress resolution on Windows
0721f2f (#7682) Add complete support for Scientific Linux
a347920 (#9183) Add support for Alpine linux detection
824fac0 (#8439) Add physicalprocessorcount and processor facts on Windows
9ef56d6 (#8439) Implement total and free physical memory on Windows
b3e2274 (#8439) Add Facter::Util::WMI module
00bed7a (#8964) Search mountinfo for selinux mount point
e8d00ec (#8964) Search mountinfo for selinux mount point
c5d63d4 Fix #2766 - silence unknown sysctl values
5d9cc84 (#8660) Fix destdir option on Windows
e329450 (#8247) Fixing arp DNS timeout issue.
15d0406 use each_line instead of each for strings in ruby 1.9
08b3f77 (#7854) Add Augeas library version fact
e84c051 Fixed #7307 - Added serial number fact to Solaris
Facter 1.6.0 Release Notes¶
License Change¶
Facter has moved to Apache 2.0 license
This is in line with our proposed plan to change
from the GPL license to Apache 2.0 for Puppet in 2.7.0 and
Facter in 1.6.0.
Please see this link for further explanation:
https://groups.google.com/d/topic/puppet-users/NuspYhMpE5o/discussion
Speed Improvements¶
(#7670) Stop preloading all facts in the application
If a requested fact isn't found in the same location as its name, we want to
load all of the facts to find it. However, to simplify that, we were previously
just preloading all the facts every time. Because requesting a fact now
implicitly loads all facts if necessary, we can rely on that, providing results
much more quickly in the case where facts do match their filenames.
Fact Detection Improvements¶
(#6728) Facter improperly detects openvzve on CloudLinux systems
Make the openvz check for more than just the vz directory to be sure it's
OpenVZ.
Update the OpenVZ fact to be slightly more resilient in it's checking of
OpenVZ, so it doesn't clash with CloudLinux's LVE container system.
(#6740) facter doesn’t always respect facts in environment variables
On an OSX host:
$ facter operatingsystem
Darwin
$ facter_operatingsystem=Not_Darwin facter operatingsystem
Not_Darwin
But on a linux/solaris host:
$ facter operatingsystem
CentOS
$ facter_operatingsystem=Not_CentOS facter operatingsystem
CentOS
As the operatingsystem fact resolution for linux-based kernels has higher
precedence than the environment variable as it has more matching confines than
the value from the environment variable.
This patch adds from_environment to the resolution mechanism, which makes the
resolution have an artificially high weight by claiming the length of its
confines array is 1 billion.
Documentation¶
(#5394) Document each Facter fact.
Document all the builtin Facter facts in puppetdoc/rdoc format.
This is laying the ground work for using a tool like puppet doc, or puppet
describe but for facter, so you can see what a fact is for and how it
resolves this. This is the "leg work" of documenting the actual facts, and
the syntax of them may change in future.
CHANGELOG Highlights¶
926e912 (#7670) Stop preloading all facts in the application
2255abe (#7670) Never fail to find a fact that is present
6b1cd16 (#6614) Update ipaddress6 fact to work with Ruby 1.9
21fe217 (#6612) Changed uptime spec to be endian agnostic
19f96b5 (#6728) Facter improperly detects openvzve on CloudLinux systems
5b10173 (#5135) Fix faulty logic in physicalprocessorcount
53cd946 Ensures that ARP facts are returned only on EC2 hosts
bfa038d Fixed #6974 - Moved to Apache 2.0 license
d56bca8 refactor the mechanism for allowing for resolution ordering to be influenced
9f4c5c6 (#6740) facter doesn't always respect facts in environment variables
bfc16f6 (#2714) Added timeout to prtdiag resulution
3efa9d7 (#3856) Add virtualbox detection via lspci (graphics card), dmidecode, and prtdiag for Solaris and corresponding tests. Darwin case is not handled yet.
7c80172 (#6883) Update Facter install.rb to be slightly more informative.
d31e3f9 (#5394) Document each Facter fact.
d6967a0 (#6613) Switch solaris macaddress fact to netstat