summaryrefslogtreecommitdiff
path: root/lib/facter/facter_dot_d.rb
AgeCommit message (Collapse)Author
2012-03-06(#12357) Make facter_dot_d look in Puppet[:confdir]/facts.dJeff McCune
On Windows, we have no folders that match up to the default set of directories the facter_dot_d fact looks in by default. This is a problem because the Puppet Enterprise installer writes out the following facts by default, and our modules require them to be present: % cat /etc/puppetlabs/facter/facts.d/puppet_enterprise_installer.txt fact_stomp_port=61613 fact_stomp_server=puppetmaster fact_is_puppetagent=true fact_is_puppetmaster=true fact_is_puppetconsole=true On windows, the Puppet confdir is quite variable. On 2003 systems we default to the All Users application data directory. On 2008 systems we default to the ProgramData directory. The actual configuration directory varies depending on the Puppet or Puppet Enterprise branding. In order to simplify all of this variable behavior, this patch fixes the problem by automatically looking for facts in `%COMMON_APPDATA%/PuppetLabs/facter/facts.d` This patch paves the way for the MSI installer to use an IniFile element to write custom facts during installation.
2012-02-07Merge branch '2.2.x'Ken Barber
* 2.2.x: (#12377) Avoid infinite loop when retrying require json
2012-02-06(#12377) Avoid infinite loop when retrying require jsonJeff McCune
Without this patch an infinite loop will be entered if the json and rubygems libraries are not available. This patch fixes the problem by retrying the `require 'json'` only if rubygems was successfully loaded for the first time. Subsequent attempts to load rubygems will cause the LoadError exception from a missing json library to be re-raised. Thanks to Krzysztof Wilczynski for pointing out this issue.
2012-02-03Update the documentation comment Richard Clamp
This is causing a little confusion, so make the comment match the behaviour.
2011-08-18(#9080) Make facts.d match Facter 2.0Jeff McCune
Based on feedback from Luke, the facts.d directory should at least match the directory that will be used by Facter 2.0. Reading #2157 I believe the Facter 2.0 facts.d feature is reasonably API compatible with this custom fact from R.I. so I'm comfortable using the same filesystem path. Change in behavior: Now look for facts in: * /etc/facter/facts.d * /etc/puppetlabs/facter/facts.d
2011-08-17(#9080) Add facts from /etc/puppetlabs/facts.dJeff McCune
This fact is a direct copy of R.I.'s work at https://github.com/ripienaar/facter-facts This is necessary plumbing to allow the installer to write a simple text file based on the role the node is receiving. For example: $ cat /etc/puppetlabs/facts.d/puppet_enterprise_mcollective.txt fact_stomp_port=61613 fact_stomp_server=puppetmaster fact_is_puppetagent=true fact_is_puppetmaster=true The mcollectivepe module relies on these facts being set and we need a persistent place to write them during the interview process and later read them when puppet agent runs to configure MCollective on the agent systems. Since stdlib is a public module, both /etc/facts.d and /etc/puppetlabs/facts.d are scanned for static facts.