From 7ea9ad17cab2544875d4934a90522dd74f0b6396 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 20 Feb 2011 13:13:37 +0100 Subject: treat case where host is not in stored configs so far --- files/master/lastruncheck | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'files') diff --git a/files/master/lastruncheck b/files/master/lastruncheck index 420730f..babe74f 100644 --- a/files/master/lastruncheck +++ b/files/master/lastruncheck @@ -96,7 +96,9 @@ module Puppet::Lastcheck::Tests::Storedconfigs storedconfigs_hosts.each do |host| if !facts_hosts.any?{|fact_host| fact_host[:hostname] == host.name } add_failed_host(host.name, "In storedconfigs but no facts available!") - elsif host.last_compile.nil? || host.last_compile < (Time.now - @timeout) + elsif host.last_compile.nil? + add_failed_host(host.name, "No entry in storedconfigs") + elsif host.last_compile < (Time.now - @timeout) add_failed_host(host.name, "Last compile time in storedconfigs at #{host.last_compile}") end end -- cgit v1.2.3 From 84d4ee9db697e35299b5c9d157bb818af1088416 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Apr 2011 14:12:05 +0200 Subject: fix lastruncheck to be compatible for 2.6.7 --- files/master/lastruncheck | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'files') diff --git a/files/master/lastruncheck b/files/master/lastruncheck index babe74f..9eff27e 100644 --- a/files/master/lastruncheck +++ b/files/master/lastruncheck @@ -23,9 +23,11 @@ module Puppet::Lastcheck def facts_hosts return @facts_hosts if @facts_hosts require 'puppet/indirector/facts/yaml' - @facts_hosts = Puppet::Node::Facts.search("*").collect do |node| - { :hostname => node.name, :expired => node.expired?, :timestamp => node.values[:_timestamp], :expiration => node.expiration } - end + @facts_hosts = Puppet::Node::Facts.search("*").collect do |fqdn| + if node = Puppet::Node::Facts.search(fqdn) + { :hostname => node.name, :expired => node.expired?, :timestamp => node.values[:_timestamp], :expiration => node.expiration } + end + end.compact end end end -- cgit v1.2.3 From 4a5a3d04a8e45cb7666e3c270b9a3ae7a4786a70 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Apr 2011 14:39:17 +0200 Subject: find not search --- files/master/lastruncheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files') diff --git a/files/master/lastruncheck b/files/master/lastruncheck index 9eff27e..fe67d21 100644 --- a/files/master/lastruncheck +++ b/files/master/lastruncheck @@ -24,7 +24,7 @@ module Puppet::Lastcheck return @facts_hosts if @facts_hosts require 'puppet/indirector/facts/yaml' @facts_hosts = Puppet::Node::Facts.search("*").collect do |fqdn| - if node = Puppet::Node::Facts.search(fqdn) + if node = Puppet::Node::Facts.find(fqdn) { :hostname => node.name, :expired => node.expired?, :timestamp => node.values[:_timestamp], :expiration => node.expiration } end end.compact -- cgit v1.2.3 From 05a9d526ab7a23dea30058dbb3ac21a9bb521dab Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 17 Apr 2011 17:21:52 +0200 Subject: no need to log to the console as we don't use puppets logging feature --- files/master/lastruncheck | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files') diff --git a/files/master/lastruncheck b/files/master/lastruncheck index fe67d21..149c655 100644 --- a/files/master/lastruncheck +++ b/files/master/lastruncheck @@ -189,7 +189,7 @@ class Puppet::Application::Lastcheck < Puppet::Application def setup exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs? - Puppet::Util::Log.newdestination :console + #Puppet::Util::Log.newdestination :console Puppet::Node::Facts.terminus_class = :yaml Puppet::Lastcheck::Tests.tests.keys.each do |test| -- cgit v1.2.3 From 618384cf08340b34a4eaf1022d200c1acb8161f4 Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Wed, 19 Jan 2011 20:09:16 -0500 Subject: Support puppet client for FreeBSD Some pieces of the puzzle are missing for being able to manage puppet in FreeBSD. * Add a default puppet client config template for FreeBSD * In FreeBSD, puppet.conf is not in /etc/puppet/ so let's provide a value for this variable in init.pp. * The rc script for starting and stopping puppet is not located in /etc/rc.d so let's signify this to Service[puppet] Signed-off-by: Gabriel Filion --- files/client/puppet.conf.FreeBSD | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 files/client/puppet.conf.FreeBSD (limited to 'files') diff --git a/files/client/puppet.conf.FreeBSD b/files/client/puppet.conf.FreeBSD new file mode 100644 index 0000000..cd8bd2a --- /dev/null +++ b/files/client/puppet.conf.FreeBSD @@ -0,0 +1,26 @@ +[main] + logdir=/var/log/puppet + vardir=/var/puppet + rundir=/var/run/puppet + + ssldir=/usr/local/etc/puppet/ssl + + # Where 3rd party plugins and modules are installed + libdir = $vardir/lib + + templatedir=$vardir/templates + + # Turn plug-in synchronization on. + pluginsync = true + pluginsource = puppet://$server/plugins + factpath = $vardir/lib/facter + +[puppetd] + report=true + server=server.example.com + + # different run-interval, default= 30min + # e.g. run puppetd every 4 hours = 14400 + # runinterval = 14400 + + logdest=$logdir/puppet.log -- cgit v1.2.3 From 56528806115735c1717408989d6d39049574333b Mon Sep 17 00:00:00 2001 From: Gabriel Filion Date: Tue, 23 Aug 2011 16:30:36 -0400 Subject: Fix ssldir value for FreeBSD config The default ssl directory in FreeBSD is /var/puppet/ssl, not /usr/local/etc/puppet/ssl With the previous value, puppet would refuse to run starting from the second run, stating that the certificates do not match. Signed-off-by: Gabriel Filion --- files/client/puppet.conf.FreeBSD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files') diff --git a/files/client/puppet.conf.FreeBSD b/files/client/puppet.conf.FreeBSD index cd8bd2a..71bcf77 100644 --- a/files/client/puppet.conf.FreeBSD +++ b/files/client/puppet.conf.FreeBSD @@ -3,7 +3,7 @@ vardir=/var/puppet rundir=/var/run/puppet - ssldir=/usr/local/etc/puppet/ssl + ssldir=/var/puppet/ssl # Where 3rd party plugins and modules are installed libdir = $vardir/lib -- cgit v1.2.3 From f700886c55273330a01c38c20365d347b8c10d4a Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 15 Oct 2011 16:25:10 +0200 Subject: Fix lastruncheck. Patch by pietro. --- files/master/lastruncheck | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'files') diff --git a/files/master/lastruncheck b/files/master/lastruncheck index 149c655..d59e489 100644 --- a/files/master/lastruncheck +++ b/files/master/lastruncheck @@ -23,8 +23,8 @@ module Puppet::Lastcheck def facts_hosts return @facts_hosts if @facts_hosts require 'puppet/indirector/facts/yaml' - @facts_hosts = Puppet::Node::Facts.search("*").collect do |fqdn| - if node = Puppet::Node::Facts.find(fqdn) + @facts_hosts = Puppet::Node::Facts.indirection.search("*").collect do |fqdn| + if node = Puppet::Node::Facts.indirection.find(fqdn) { :hostname => node.name, :expired => node.expired?, :timestamp => node.values[:_timestamp], :expiration => node.expiration } end end.compact @@ -190,7 +190,7 @@ class Puppet::Application::Lastcheck < Puppet::Application exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs? #Puppet::Util::Log.newdestination :console - Puppet::Node::Facts.terminus_class = :yaml + Puppet::Node::Facts.indirection.terminus_class = :yaml Puppet::Lastcheck::Tests.tests.keys.each do |test| self.send("ignore_#{test}=", Puppet::Lastcheck::Tests.tests[test][:ignore_by_default]||false) unless self.send("ignore_#{test}") -- cgit v1.2.3