From 7f9b77c7f6dbc110f20d7c191c27ceba7bdb49a9 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 19 Jan 2010 23:04:10 +0100 Subject: took out "server=puppet.glei.ch" --- files/client/puppet.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/client/puppet.conf b/files/client/puppet.conf index ee14a20..4a1da55 100644 --- a/files/client/puppet.conf +++ b/files/client/puppet.conf @@ -18,7 +18,7 @@ [puppetd] report=true - server=puppet.glei.ch + #server=[fqdn here please] # different run-interval, default= 30min # e.g. run puppetd every 4 hours = 14400 -- cgit v1.2.3 From afebc17bb91d91ea614503c567eb0d591127d6d7 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 19 Jan 2010 23:42:46 +0100 Subject: added ubuntu support --- manifests/cron/base.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp index 3f7f8c0..7244e02 100644 --- a/manifests/cron/base.pp +++ b/manifests/cron/base.pp @@ -8,7 +8,7 @@ class puppet::cron::base inherits puppet::base { notify => undef } case $operatingsystem { - debian,openbsd: { + debian,openbsd,ubuntu: { #it's already disabled } default: { -- cgit v1.2.3 From 5858994b09d7efecbe3c56cb1c6cbb74f1dc997e Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 19 Jan 2010 23:57:56 +0100 Subject: added ubuntu support --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 6ad8504..0b21aea 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -24,7 +24,7 @@ class puppet { case $operatingsystem { gentoo: { include puppet::gentoo } centos: { include puppet::centos } - debian: { include puppet::debian } + debian,ubuntu: { include puppet::debian } default: { include puppet::linux} } } -- cgit v1.2.3 From e53616384acf3678367f26a2e210381c5427d305 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 20 Jan 2010 00:18:23 +0100 Subject: added cron reload to recognize cronfile changes --- manifests/debian.pp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/manifests/debian.pp b/manifests/debian.pp index 62c7661..f078601 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -13,4 +13,13 @@ class puppet::debian inherits puppet::linux { File['/etc/cron.d/puppetd.cron']{ path => '/etc/cron.d/puppetd', } + + service{'cron': + name => 'cron', + enable => true, + ensure => running, + hasstatus => true, + } + + } -- cgit v1.2.3 From 48e7f20051726623236b8dac1433ea7eddff2db7 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 20 Jan 2010 00:39:40 +0100 Subject: cron reload for /etc/cron.d/puppet*, debian/ubuntu shellscripts under /usr/local/bin rather than /opt/bin --- manifests/linux.pp | 3 ++- manifests/puppetmaster/checklastrun.pp | 17 +++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/manifests/linux.pp b/manifests/linux.pp index afbda8d..55fa623 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -13,6 +13,7 @@ class puppet::linux inherits puppet::base { file{'/etc/cron.d/puppetd.cron': source => [ "puppet://$server/modules/puppet/cron.d/puppetd.${operatingsystem}", "puppet://$server/modules/puppet/cron.d/puppetd" ], - owner => root, group => 0, mode => 0644; + owner => root, group => 0, mode => 0644, + notify => service["cron"]; } } diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp index 12f1042..76bfaec 100644 --- a/manifests/puppetmaster/checklastrun.pp +++ b/manifests/puppetmaster/checklastrun.pp @@ -1,12 +1,21 @@ class puppet::puppetmaster::checklastrun { - file{'/opt/bin/puppetlast': + case $operatingsystem { + debian,ubuntu: { $puppetlast_dest = "/usr/local/bin/puppetlast" } + default: { $puppetlast_dest = "/opt/bin/puppetlast" } + } + + + + + file{"$puppetlast_dest": source => [ "puppet://$server/modules/site-puppet/master/puppetlast", "puppet://$server/modules/puppet/master/puppetlast"], owner => root, group => 0, mode => 0700; } file{'/etc/cron.d/puppetlast.cron': - content => "40 10,22 * * * root /opt/bin/puppetlast\n", - require => File['/opt/bin/puppetlast'], - owner => root, group => 0, mode => 0644; + content => "40 10,22 * * * root $puppetlast_dest\n", + require => File["$puppetlast_dest"], + owner => root, group => 0, mode => 0644, + notify => service["cron"]; } } -- cgit v1.2.3 From 7bc3dcb8dc1f968c5da9876b969de9c32eedf325 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 20 Jan 2010 00:41:51 +0100 Subject: added debian support --- manifests/puppetmaster/package.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manifests/puppetmaster/package.pp b/manifests/puppetmaster/package.pp index d7c477d..c91dbe8 100644 --- a/manifests/puppetmaster/package.pp +++ b/manifests/puppetmaster/package.pp @@ -1,9 +1,14 @@ # manifests/puppetmaster/package.pp class puppet::puppetmaster::package inherits puppet::puppetmaster::linux { - package { puppet-server: ensure => present } + case $operatingsystem { + debian: { $puppetmaster_package="puppetmaster" } + default: { $puppetmaster_package="puppet-server" } + } + + package { $puppetmaster_package: ensure => present } Service[puppetmaster]{ - require +> Package[puppet-server], + require +> Package[$puppetmaster_package], } } -- cgit v1.2.3 From f9afc62958b81106b7849413142e1ba448132401 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 20 Jan 2010 00:43:00 +0100 Subject: stroedconfig depends on mysql::server, for debian use libmysql-ruby deb --- manifests/puppetmaster/storeconfigs.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/manifests/puppetmaster/storeconfigs.pp b/manifests/puppetmaster/storeconfigs.pp index 32aaa7f..1b6d759 100644 --- a/manifests/puppetmaster/storeconfigs.pp +++ b/manifests/puppetmaster/storeconfigs.pp @@ -2,4 +2,12 @@ # so storeconfigs works. class puppet::puppetmaster::storeconfigs { include rails + include mysql::server + + case $operatingsystem { + debian: { package { libmysql-ruby: ensure => present } } + + } + + } -- cgit v1.2.3 From f5308a18abf6340eb125a90ac6d507a06519ef81 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 20 Jan 2010 13:28:07 +0100 Subject: added a simple README, tbc... --- README | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..9890d31 --- /dev/null +++ b/README @@ -0,0 +1,14 @@ +Puppet-Module for configuring Puppet itself, both the master and the clients +============================================================================ + +Use a seperate local module called "site-puppet", where you place your customized +files, under: + site-puppet/files/master/fileserver.conf + site-puppet/files/master/puppet.conf + +those files in this module are just examples. + +Usage +----- + +...tbc... -- cgit v1.2.3 From 1436c939bdb2ef131a6ff71e63d9e6909a228651 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 20 Jan 2010 14:03:46 +0100 Subject: removed service definition for cron, which should be in an own cron-module --- manifests/debian.pp | 8 -------- manifests/linux.pp | 2 +- manifests/puppetmaster/checklastrun.pp | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/manifests/debian.pp b/manifests/debian.pp index f078601..507ec52 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -14,12 +14,4 @@ class puppet::debian inherits puppet::linux { path => '/etc/cron.d/puppetd', } - service{'cron': - name => 'cron', - enable => true, - ensure => running, - hasstatus => true, - } - - } diff --git a/manifests/linux.pp b/manifests/linux.pp index 55fa623..09d0824 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -14,6 +14,6 @@ class puppet::linux inherits puppet::base { source => [ "puppet://$server/modules/puppet/cron.d/puppetd.${operatingsystem}", "puppet://$server/modules/puppet/cron.d/puppetd" ], owner => root, group => 0, mode => 0644, - notify => service["cron"]; + notify => service["crond"]; } } diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp index 76bfaec..7eae8a3 100644 --- a/manifests/puppetmaster/checklastrun.pp +++ b/manifests/puppetmaster/checklastrun.pp @@ -16,6 +16,6 @@ class puppet::puppetmaster::checklastrun { content => "40 10,22 * * * root $puppetlast_dest\n", require => File["$puppetlast_dest"], owner => root, group => 0, mode => 0644, - notify => service["cron"]; + notify => service["crond"]; } } -- cgit v1.2.3 From 9e54a92395046dde9a588e3d8e80ded99745ade2 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 20 Jan 2010 14:08:29 +0100 Subject: changed destination from /opt/bin/puppetlast to /usr/local/bin --- manifests/puppetmaster/checklastrun.pp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/manifests/puppetmaster/checklastrun.pp b/manifests/puppetmaster/checklastrun.pp index 7eae8a3..fdcc096 100644 --- a/manifests/puppetmaster/checklastrun.pp +++ b/manifests/puppetmaster/checklastrun.pp @@ -1,20 +1,12 @@ class puppet::puppetmaster::checklastrun { - case $operatingsystem { - debian,ubuntu: { $puppetlast_dest = "/usr/local/bin/puppetlast" } - default: { $puppetlast_dest = "/opt/bin/puppetlast" } - } - - - - - file{"$puppetlast_dest": + file{"/usr/local/bin/puppetlast": source => [ "puppet://$server/modules/site-puppet/master/puppetlast", "puppet://$server/modules/puppet/master/puppetlast"], owner => root, group => 0, mode => 0700; } file{'/etc/cron.d/puppetlast.cron': - content => "40 10,22 * * * root $puppetlast_dest\n", - require => File["$puppetlast_dest"], + content => "40 10,22 * * * root /usr/local/bin/puppetlast\n", + require => File["/usr/local/bin/puppetlast"], owner => root, group => 0, mode => 0644, notify => service["crond"]; } -- cgit v1.2.3 From 373617edd3b17ac5605d525e5e96ec5494e573c7 Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 24 Jan 2010 12:14:50 +0100 Subject: added apache/passenger config variables --- files/master/puppet.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/files/master/puppet.conf b/files/master/puppet.conf index bcf2a23..0027e57 100644 --- a/files/master/puppet.conf +++ b/files/master/puppet.conf @@ -54,6 +54,11 @@ #usage for clusters #ssl_client_header=HTTP_X_SSL_SUBJECT + # apache2/passenger usage: http://github.com/reductivelabs/puppet/tree/master/ext/rack + ssl_client_header = SSL_CLIENT_S_DN + ssl_client_verify_header = SSL_CLIENT_VERIFY + + # specify allowed environments environments=production,development -- cgit v1.2.3 From 8f8a6d24375057029d8fefb2a2a78a22e07e964d Mon Sep 17 00:00:00 2001 From: varac Date: Sun, 24 Jan 2010 12:18:12 +0100 Subject: Added puppet::puppetmaster::passenger class to enable apache/passenger support --- files/master/config.ru | 27 ++++++++++++++++++++++ manifests/puppetmaster/passenger.pp | 45 +++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 files/master/config.ru create mode 100644 manifests/puppetmaster/passenger.pp diff --git a/files/master/config.ru b/files/master/config.ru new file mode 100644 index 0000000..b9d8fbc --- /dev/null +++ b/files/master/config.ru @@ -0,0 +1,27 @@ +# a config.ru, for use with every rack-compatible webserver. +# SSL needs to be handled outside this, though. + +# if puppet is not in your RUBYLIB: +# $:.unshift('/opt/puppet/lib') + +$0 = "puppetmasterd" +require 'puppet' + +# logs to file instead of syslog +#Puppet::Util::Log.newdestination("/var/log/puppet/puppetmasterd.log") + +# if you want debugging: +#ARGV << "--debug" + +ARGV << "--rack" + +# in some setups puppetmasterd doesn't seem to read the puppet.conf +# config at startup, then you need to pass these options: +ARGV << "--vardir" << "/var/lib/puppet" +ARGV << "--ssldir" << "/var/lib/puppet/ssl" + + +require 'puppet/application/puppetmasterd' +# we're usually running inside a Rack::Builder.new {} block, +# therefore we need to call run *here*. +run Puppet::Application[:puppetmasterd].run diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp new file mode 100644 index 0000000..63b2fab --- /dev/null +++ b/manifests/puppetmaster/passenger.pp @@ -0,0 +1,45 @@ +# class to use passenger for serving puppetmaster + +class puppet::puppetmaster::passenger { + + case $operatingsystem { + debian: { include puppet::puppetmaster::passenger::debian } + defaults: { include puppet::puppetmaster::passenger::base } + } +} + +class puppet::puppetmaster::passenger::debian inherits puppet::puppetmaster::passenger::base { + # according to http://github.com/reductivelabs/puppet/tree/master/ext/rack rack needs + # to be version >= 1.0.0 . lenny-backports provide it + package { "librack-ruby": ensure => "1.0.0-2~bpo50+1" } + package { "librack-ruby1.8": ensure => "1.0.0-2~bpo50+1" } + + apache::config::global{ 'puppet-apache2-passenger.conf': } + apache::debian::module { 'ssl': ensure => present } + apache::debian::module { 'passenger': ensure => present } + apache::debian::module { 'headers': ensure => present } +} + +class puppet::puppetmaster::passenger::base { + notice ( "class puppet::puppetmaster::passenger::base needs to be configured for using passenger with non-debian OS !" ) + + include apache + include passenger::apache + + + # http://github.com/reductivelabs/puppet/tree/master/ext/rack + file { ["/etc/puppet/rack", "/etc/puppet/rack/public"]: + ensure => directory, + mode => 0755, + owner => root, + group => root, + } + file { "/etc/puppet/rack/config.ru": + ensure => present, + source => "puppet:///modules/puppet/master/config.ru", + mode => 0644, + owner => puppet, + group => root, + } +} + -- cgit v1.2.3 From 1234c4df2d8d02d12ae0f1fc0f6e04e149affce7 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 3 Feb 2010 11:00:11 +0100 Subject: added vardir + ssldir because passenger driven puppetmasterd sometimes doesn't read the config at the very startup --- files/master/config.ru | 2 ++ 1 file changed, 2 insertions(+) diff --git a/files/master/config.ru b/files/master/config.ru index b9d8fbc..cec2a34 100644 --- a/files/master/config.ru +++ b/files/master/config.ru @@ -20,6 +20,8 @@ ARGV << "--rack" ARGV << "--vardir" << "/var/lib/puppet" ARGV << "--ssldir" << "/var/lib/puppet/ssl" +# if you use puppet-dashboard: +#ARGV << "--reports" << "puppet_dashboard" require 'puppet/application/puppetmasterd' # we're usually running inside a Rack::Builder.new {} block, -- cgit v1.2.3 From 6c53d854f41ddf9b1ea3baf97cff5ecfed194f1e Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 3 Feb 2010 11:05:07 +0100 Subject: puppet.conf is now 600, owned by puppet, because apache/passenger needs to access it as user puppet --- manifests/base.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/base.pp b/manifests/base.pp index 081df5e..ebf4d7a 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -11,7 +11,9 @@ class puppet::base { "puppet://$server/modules/puppet/client/puppet.conf.$operatingsystem", "puppet://$server/modules/puppet/client/puppet.conf" ], notify => Service[puppet], - owner => root, group => 0, mode => 600; + # if puppetmasterd is deployed by apache2/passenger it needs to read puppet.conf + # therefore it must be readable by puppet + owner => puppet, group => 0, mode => 600; } service{'puppet': ensure => running, -- cgit v1.2.3 From 32d27ed3e0378a5e4545e247115e371b92b9924e Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 3 Feb 2010 11:14:52 +0100 Subject: restructured a bit manifests/puppetmaster/passenger.pp --- manifests/puppetmaster/passenger.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp index 63b2fab..06e2a2b 100644 --- a/manifests/puppetmaster/passenger.pp +++ b/manifests/puppetmaster/passenger.pp @@ -4,7 +4,8 @@ class puppet::puppetmaster::passenger { case $operatingsystem { debian: { include puppet::puppetmaster::passenger::debian } - defaults: { include puppet::puppetmaster::passenger::base } + defaults: { notice ( "class puppet::puppetmaster::passenger::base needs to be configured for using passenger with non-debian OS !" ) + include puppet::puppetmaster::passenger::base } } } @@ -21,7 +22,6 @@ class puppet::puppetmaster::passenger::debian inherits puppet::puppetmaster::pas } class puppet::puppetmaster::passenger::base { - notice ( "class puppet::puppetmaster::passenger::base needs to be configured for using passenger with non-debian OS !" ) include apache include passenger::apache -- cgit v1.2.3 From a15d322a91e6c438f65a23b4fe5fb8d63c32def0 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 4 Feb 2010 17:44:26 +0100 Subject: Allowes puppet::cron also on the puppetmaster server --- manifests/cron/base.pp | 10 ++++++++-- manifests/puppetmaster/base.pp | 27 ++++++++++++++++++--------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/manifests/cron/base.pp b/manifests/cron/base.pp index 7244e02..5fc55d2 100644 --- a/manifests/cron/base.pp +++ b/manifests/cron/base.pp @@ -4,9 +4,15 @@ class puppet::cron::base inherits puppet::base { Service['puppet']{ enable => false, } - File['puppet_config']{ - notify => undef + + if defined (puppet::puppetmaster) {} + else { + File['puppet_config']{ + notify => undef + } } + + case $operatingsystem { debian,openbsd,ubuntu: { #it's already disabled diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index 0b208b0..2305725 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -1,9 +1,18 @@ class puppet::puppetmaster::base inherits puppet::base { + if defined (puppet::cron) { + File[puppet_config]{ + source => [ "puppet://$server/modules/site-puppet/master/puppet.conf", + "puppet://$server/modules/puppet/master/puppet.conf" ], + notify => Service[puppetmaster], + } + } + else { + File[puppet_config]{ + source => [ "puppet://$server/modules/site-puppet/master/puppet.conf", + "puppet://$server/modules/puppet/master/puppet.conf" ], + notify => [Service[puppet],Service[puppetmaster] ], + } - File[puppet_config]{ - source => [ "puppet://$server/modules/site-puppet/master/puppet.conf", - "puppet://$server/modules/puppet/master/puppet.conf" ], - notify => [Service[puppet],Service[puppetmaster] ], } $real_puppet_fileserverconfig = $puppet_fileserverconfig ? { @@ -12,12 +21,12 @@ class puppet::puppetmaster::base inherits puppet::base { } file { "$real_puppet_fileserverconfig": - source => [ "puppet://$server/modules/site-puppet/master/${fqdn}/fileserver.conf", - "puppet://$server/modules/site-puppet/master/fileserver.conf", - "puppet://$server/modules/puppet/master/fileserver.conf" ], - notify => [Service[puppet],Service[puppetmaster] ], + source => [ "puppet://$server/modules/site-puppet/master/${fqdn}/fileserver.conf", + "puppet://$server/modules/site-puppet/master/fileserver.conf", + "puppet://$server/modules/puppet/master/fileserver.conf" ], + notify => [Service[puppet],Service[puppetmaster] ], owner => root, group => puppet, mode => 640; - } + } if $puppetmaster_storeconfigs { include puppet::puppetmaster::storeconfigs -- cgit v1.2.3 From 3decda724d069d976ac92e80b79bbd4ccd5a29de Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 10 Feb 2010 10:41:04 +0100 Subject: with puppet::puppetmaster::passenger, service puppetmaster restarts apache2 --- manifests/puppetmaster/linux.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/manifests/puppetmaster/linux.pp b/manifests/puppetmaster/linux.pp index 43cd841..abb7bb8 100644 --- a/manifests/puppetmaster/linux.pp +++ b/manifests/puppetmaster/linux.pp @@ -1,10 +1,18 @@ # manifests/puppetmaster/linux.pp class puppet::puppetmaster::linux inherits puppet::linux { + +if defined (puppet::puppetmaster::passenger) { + $puppetmaster_servicename = "puppetmaster" } + else { + $puppetmaster_servicename = "apache2" + } + service{'puppetmaster': ensure => running, - enable => true, + name => $puppetmaster_servicename, + enable => true, require => [ Package[puppet] ], } -- cgit v1.2.3 From 1a8a9c59bd480e0dbd5743d0c0d9babf9de4c687 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 10 Feb 2010 10:57:38 +0100 Subject: Readme: Depends on --- README | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README b/README index 9890d31..d2564b4 100644 --- a/README +++ b/README @@ -8,6 +8,11 @@ files, under: those files in this module are just examples. +Depends on Modules +------------------ +- bc +- cron + Usage ----- -- cgit v1.2.3 From e389655f467038461b42d6ba8d71e87be8622c5f Mon Sep 17 00:00:00 2001 From: nadir Date: Mon, 15 Feb 2010 17:05:36 +0100 Subject: cleaned puppet.conf for the clients --- files/client/puppet.conf | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/files/client/puppet.conf b/files/client/puppet.conf index 4a1da55..e165f73 100644 --- a/files/client/puppet.conf +++ b/files/client/puppet.conf @@ -3,18 +3,14 @@ vardir=/var/lib/puppet rundir=/var/run/puppet - #ssldir=/var/lib/puppet/ssl ssldir=$vardir/ssl # Where 3rd party plugins and modules are installed - libdir = /var/lib/puppet/lib + libdir = $vardir/lib - templatedir=/var/lib/puppet/templates + templatedir=$vardir/templates - # Turn plug-in synchronization on. - pluginsync = true - pluginsource = puppet://$server/plugins - factpath = $vardir/lib/facter + factpath = $libdir/facter [puppetd] report=true -- cgit v1.2.3 From dfdb96c1c071b817d9ccc50cd2e4790a36a78ec7 Mon Sep 17 00:00:00 2001 From: nadir Date: Wed, 17 Feb 2010 14:25:28 +0100 Subject: On puppet::puppetmaster::passenger apache2 needs to be restarted instead of puppetmasted --- manifests/puppetmaster/linux.pp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/manifests/puppetmaster/linux.pp b/manifests/puppetmaster/linux.pp index abb7bb8..2a71dd4 100644 --- a/manifests/puppetmaster/linux.pp +++ b/manifests/puppetmaster/linux.pp @@ -2,20 +2,27 @@ class puppet::puppetmaster::linux inherits puppet::linux { -if defined (puppet::puppetmaster::passenger) { - $puppetmaster_servicename = "puppetmaster" } + if defined (puppet::puppetmaster::passenger) { + service{'puppetmaster': + ensure => running, + #name => apache2, + #enable => true, + pattern => 'apache2', + hasstatus => true, + start => '/etc/init.d/apache2 start', + stop => '/etc/init.d/apache2 start', + restart => '/etc/init.d/apache2 restart', + status => 'pgrep apache2', + require => [ Package[puppet] ], + } + } else { - $puppetmaster_servicename = "apache2" - } - - - service{'puppetmaster': - ensure => running, - name => $puppetmaster_servicename, - enable => true, - require => [ Package[puppet] ], + service{'puppetmaster': + ensure => running, + enable => true, + require => [ Package[puppet] ], + } } - Service[puppet]{ require +> Service[puppetmaster], } -- cgit v1.2.3 From 23c385e39e89ffd326bf12ad2d7b1640d4f65a95 Mon Sep 17 00:00:00 2001 From: nadir Date: Sun, 7 Mar 2010 22:56:02 +0100 Subject: README, added $puppet_crontime to tune how often a client gets updates --- README | 13 +++++++++++++ manifests/cron/linux.pp | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README b/README index d2564b4..916ce68 100644 --- a/README +++ b/README @@ -15,5 +15,18 @@ Depends on Modules Usage ----- +in your site.pp, i.e. : + + $puppet_crontime = "0,12 * * * *" + include puppet::cron + + include puppet::puppetmaster + + include puppet::puppetmaster::passenger + + $puppet_storeconfig_password="..." + include puppet::puppetmaster::storeconfigs + + ...tbc... diff --git a/manifests/cron/linux.pp b/manifests/cron/linux.pp index be17498..75f11a3 100644 --- a/manifests/cron/linux.pp +++ b/manifests/cron/linux.pp @@ -4,9 +4,15 @@ class puppet::cron::linux inherits puppet::linux { case $puppet_config { '': { $puppet_config = '/etc/puppet/puppet.conf' } } + + case $puppet_crontime { + '': { $puppet_crontime = '0,30 * * * *' } + } + + File['/etc/cron.d/puppetd.cron']{ source => undef, content => "# run puppet -0,30 * * * * root /usr/sbin/puppetd --onetime --no-daemonize --splay --config=$puppet_config --color false | grep -E '(^err:|^alert:|^emerg:|^crit:)'\n", +$puppet_crontime root /usr/sbin/puppetd --onetime --no-daemonize --splay --config=$puppet_config --color false | grep -E '(^err:|^alert:|^emerg:|^crit:)'\n", } } -- cgit v1.2.3 From fc72cbc8a9d09b2d305df061dfc74cc960610d85 Mon Sep 17 00:00:00 2001 From: nadir Date: Sun, 7 Mar 2010 23:06:33 +0100 Subject: When using Passenger, we don't need /etc/cron.d/puppetmaster.cron --- manifests/puppetmaster/base.pp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index 2305725..4a1cb6f 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -32,11 +32,14 @@ class puppet::puppetmaster::base inherits puppet::base { include puppet::puppetmaster::storeconfigs } - # restart the master from time to time to avoid memory problems - file{'/etc/cron.d/puppetmaster.cron': - source => [ "puppet://$server/modules/puppet/cron.d/puppetmaster.${operatingsystem}", - "puppet://$server/modules/puppet/cron.d/puppetmaster" ], - owner => root, group => 0, mode => 0644; + + if ! defined (puppet::puppetmaster::passenger) { + # restart the master from time to time to avoid memory problems + file{'/etc/cron.d/puppetmaster.cron': + source => [ "puppet://$server/modules/puppet/cron.d/puppetmaster.${operatingsystem}", + "puppet://$server/modules/puppet/cron.d/puppetmaster" ], + owner => root, group => 0, mode => 0644; + } } file{'/etc/cron.daily/puppet_reports_cleanup.sh': -- cgit v1.2.3