summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/master/lastruncheck16
-rw-r--r--manifests/cron/base.pp46
-rw-r--r--manifests/cron/linux.pp1
-rw-r--r--manifests/linux.pp1
-rw-r--r--manifests/puppetmaster.pp2
-rw-r--r--manifests/puppetmaster/base.pp2
6 files changed, 36 insertions, 32 deletions
diff --git a/files/master/lastruncheck b/files/master/lastruncheck
index 420730f..d59e489 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.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
end
end
end
@@ -96,7 +98,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
@@ -185,8 +189,8 @@ 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::Node::Facts.terminus_class = :yaml
+ #Puppet::Util::Log.newdestination :console
+ 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}")
diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp
index 7b40da6..7daa6fb 100644
--- a/manifests/cron/base.pp
+++ b/manifests/cron/base.pp
@@ -1,34 +1,32 @@
# manifests/cron/base.pp
class puppet::cron::base inherits puppet::base {
-
- case $operatingsystem {
- debian: { if $lsbdistcodename != 'lenny' { $stop_service = true } else { $stop_service = false } }
- openbsd, ubuntu: { $stop_service = false }
- default: { $stop_service = true }
- }
-
+
Service['puppet']{
enable => false,
}
- if $stop_service == true {
- $puppet_majorversion = regsubst($puppetversion,'^(\d+\.\d+).*$','\1')
- if $puppet_majorversion == '2.6' {
- Service['puppet']{
- ensure => stopped,
- }
- } else {
- Service['puppet']{
- hasstatus => false,
- pattern => 'puppetd',
- }
- # this works only on < 2.6
- exec { 'stop_puppet':
- command => 'kill `cat /var/run/puppet/puppetd.pid`',
- onlyif => 'test -f /var/run/puppet/puppetd.pid',
- require => Service['puppet'],
+ case $operatingsystem {
+ debian,openbsd,ubuntu: {
+ #it's already disabled
+ }
+ default: {
+ $puppet_majorversion = regsubst($puppetversion,'^(\d+\.\d+).*$','\1')
+ if $puppet_majorversion == '2.6' {
+ Service['puppet']{
+ ensure => stopped,
+ }
+ } else {
+ Service['puppet']{
+ hasstatus => false,
+ pattern => 'puppetd',
+ }
+ # this works only on < 2.6
+ exec { 'stop_puppet':
+ command => 'kill `cat /var/run/puppet/puppetd.pid`',
+ onlyif => 'test -f /var/run/puppet/puppetd.pid',
+ require => Service['puppet'],
+ }
}
}
}
}
-
diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp
index bab9564..5003559 100644
--- a/manifests/cron/linux.pp
+++ b/manifests/cron/linux.pp
@@ -16,5 +16,6 @@ class puppet::cron::linux inherits puppet::linux {
source => undef,
content => "#run puppet\n$puppet_crontime root output=\$(/usr/sbin/puppetd --onetime --no-daemonize --splay --config=/etc/puppet/puppet.conf --color false); ret=\$?; printf \"\\%s\" \"\$output\" | grep -E '(^err:|^alert:|^emerg:|^crit:)'; exit \$ret\n",
before => Service['puppet'],
+ ensure => present
}
}
diff --git a/manifests/linux.pp b/manifests/linux.pp
index fcd3936..13788ef 100644
--- a/manifests/linux.pp
+++ b/manifests/linux.pp
@@ -19,5 +19,6 @@ class puppet::linux inherits puppet::base {
"puppet:///modules/puppet/cron.d/puppetd.${operatingsystem}",
"puppet:///modules/puppet/cron.d/puppetd" ],
owner => root, group => 0, mode => 0644,
+ ensure => absent
}
}
diff --git a/manifests/puppetmaster.pp b/manifests/puppetmaster.pp
index 4d1960d..3e8711c 100644
--- a/manifests/puppetmaster.pp
+++ b/manifests/puppetmaster.pp
@@ -24,7 +24,7 @@ class puppet::puppetmaster inherits puppet {
}
if $puppetmaster_mode == 'passenger' {
- include puppet::puppetmaster::pasenger
+ include puppet::puppetmaster::passenger
} elsif $puppetmaster_mode == 'cluster' {
include puppet::puppetmaster::cluster
}
diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp
index 0000513..f2d8613 100644
--- a/manifests/puppetmaster/base.pp
+++ b/manifests/puppetmaster/base.pp
@@ -20,7 +20,7 @@ class puppet::puppetmaster::base inherits puppet::base {
if $puppetmaster_mode == 'passenger' {
- include puppet::puppetmaster::pasenger
+ include puppet::puppetmaster::passenger
File[$puppet_fileserverconfig]{
notify => Exec['notify_passenger_puppetmaster'],
}