diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/puppet/configuration.rb | 6 | ||||
-rw-r--r-- | lib/puppet/network/client/master.rb | 17 |
2 files changed, 18 insertions, 5 deletions
diff --git a/lib/puppet/configuration.rb b/lib/puppet/configuration.rb index c6ca53d98..3b90916c6 100644 --- a/lib/puppet/configuration.rb +++ b/lib/puppet/configuration.rb @@ -396,7 +396,11 @@ module Puppet change or if the server changes." ], :downcasefacts => [false, - "Whether facts should be made all lowercase when sent to the server."] + "Whether facts should be made all lowercase when sent to the server."], + :dynamicfacts => ["memorysize,memoryfree,swapsize,swapfree", + "Facts that are dynamic; these facts will be ignored when deciding whether + changed facts should result in a recompile. Multiple facts should be + comma-separated."] ) self.setdefaults(:puppetd, diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index 6db2e98c7..e7739ba34 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -41,6 +41,11 @@ class Puppet::Network::Client::Master < Puppet::Network::Client facts end + # Return the list of dynamic facts as an array of symbols + def self.dynamic_facts + Puppet.config[:dynamicfacts].split(/\s*,\s*/).collect { |fact| fact.downcase } + end + # This method actually applies the configuration. def apply(tags = nil, ignoreschedules = false) unless defined? @objects @@ -536,13 +541,17 @@ class Puppet::Network::Client::Master < Puppet::Network::Client end loadfacts() - - private # Have the facts changed since we last compiled? def facts_changed?(facts) - oldfacts = Puppet::Util::Storage.cache(:configuration)[:facts] - newfacts = facts + oldfacts = Puppet::Util::Storage.cache(:configuration)[:facts].dup + newfacts = facts.dup + self.class.dynamic_facts.each do |fact| + [oldfacts, newfacts].each do |facthash| + facthash.delete(fact) if facthash.include?(fact) + end + end + if oldfacts == newfacts return false else |