From 51c7b390694d95e7096e33317de4242d67ca7e38 Mon Sep 17 00:00:00 2001 From: Keith aka fugit Date: Wed, 13 Apr 2011 10:35:57 -0400 Subject: updated allow insatll of puppetmaster on squeeze. This addresses the package diferences. --- files/master/puppet.conf | 4 ++-- manifests/puppetmaster/debian.pp | 1 + manifests/puppetmaster/package/debian.pp | 25 ++++++++++++++++++++++--- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/files/master/puppet.conf b/files/master/puppet.conf index 6b4b0e9..fcaef0d 100644 --- a/files/master/puppet.conf +++ b/files/master/puppet.conf @@ -42,7 +42,7 @@ [puppetmasterd] reportdir = $logdir/reports autoflush = true - storeconfigs=true + #storeconfigs=true dbadapter=mysql dbserver=localhost dbuser=puppet @@ -63,7 +63,7 @@ # configure environments [development] manifest=$vardir/development/etc/manifests/site.pp - modulepath=$vardir/development/manifests + modulepath=$vardir/development/modules/ templatepath=$vardir/development/templates/ [production] diff --git a/manifests/puppetmaster/debian.pp b/manifests/puppetmaster/debian.pp index 8cee0ea..810c5a7 100644 --- a/manifests/puppetmaster/debian.pp +++ b/manifests/puppetmaster/debian.pp @@ -1,5 +1,6 @@ class puppet::puppetmaster::debian inherits puppet::puppetmaster::package { + if $puppetmaster_mode != 'passenger' { case $lsbdistcodename { squeeze,sid: { diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 33d7d5e..4c4f68b 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -1,6 +1,25 @@ -class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package { +class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package::base { - Package['puppetmaster']{ - require => Package['puppetmaster-common'] + if !$puppetmaster_ensure_version { $puppetmaster_ensure_version = 'installed' } + case $lsbdistcodename { + wheezy,sid: { + $puppetmaster_common_required = 'puppetmaster-common' + $puppetmaster_common_ensure = $puppetmaster_ensure_version + } + } + + Package["puppetmaster"]{ + require => $puppetmaster_common_required ? { + '' => undef, + default => Package["$puppetmaster_common_required"] + }, + ensure => $puppetmaster_ensure_version, + } + + package { "puppetmaster-common": + ensure => $puppetmaster_common_ensure ? { + '' => absent, + default => $puppetmaster_common_ensure + }, } } -- cgit v1.2.3 From 9e820e4eddaa0b0f86f816dce974a648e0769c42 Mon Sep 17 00:00:00 2001 From: Keith aka fugit Date: Wed, 13 Apr 2011 10:49:45 -0400 Subject: removed errant space --- manifests/puppetmaster/debian.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/puppetmaster/debian.pp b/manifests/puppetmaster/debian.pp index 810c5a7..8cee0ea 100644 --- a/manifests/puppetmaster/debian.pp +++ b/manifests/puppetmaster/debian.pp @@ -1,6 +1,5 @@ class puppet::puppetmaster::debian inherits puppet::puppetmaster::package { - if $puppetmaster_mode != 'passenger' { case $lsbdistcodename { squeeze,sid: { -- cgit v1.2.3 From bc4fa29b454691b6c446b2881b4b3ea39d6b8272 Mon Sep 17 00:00:00 2001 From: Keith aka fugit Date: Fri, 22 Apr 2011 10:37:28 -0400 Subject: Declared the inclusion of an external package. This should be removed for public use or incorporated into the puppet module --- manifests/puppetmaster/passenger.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp index c4bc062..0471234 100644 --- a/manifests/puppetmaster/passenger.pp +++ b/manifests/puppetmaster/passenger.pp @@ -3,6 +3,7 @@ class puppet::puppetmaster::passenger inherits puppet::puppetmaster::base { include ::passenger + include mod-passenger # A reference configuration is available at : # http://github.com/reductivelabs/puppet/tree/master/ext/rack -- cgit v1.2.3 From bc853371f8d890a376e522b55111537c0c5ff8b2 Mon Sep 17 00:00:00 2001 From: Keith aka fugit Date: Fri, 22 Apr 2011 10:44:48 -0400 Subject: added fqdn path call for source puppet.conf --- manifests/puppetmaster/base.pp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index 6ac1e0c..b1fca5a 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -1,8 +1,11 @@ class puppet::puppetmaster::base inherits puppet::base { File[puppet_config]{ - source => [ "puppet:///modules/site-puppet/master/puppet.conf", - "puppet:///modules/puppet/master/puppet.conf" ], + source => [ + "puppet:///modules/site-puppet/master/${fqdn}/puppet.conf", + "puppet:///modules/site-puppet/master/puppet.conf", + "puppet:///modules/puppet/master/puppet.conf", + ], } if !$puppet_fileserverconfig { $puppet_fileserverconfig = '/etc/puppet/fileserver.conf' } -- cgit v1.2.3 From 66ce6a1344ab711b29897a26ab60da14f295fa6e Mon Sep 17 00:00:00 2001 From: Keith aka fugit Date: Fri, 22 Apr 2011 10:47:22 -0400 Subject: Fixed typos in the spelling of passenger in includes --- manifests/puppetmaster.pp | 2 +- manifests/puppetmaster/base.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 b1fca5a..f179d47 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -23,7 +23,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'], } -- cgit v1.2.3 From 48affeddf6b343452e44cacd7b0d97295ba79a7b Mon Sep 17 00:00:00 2001 From: Keith aka fugit Date: Fri, 22 Apr 2011 10:50:27 -0400 Subject: Fix the notify call for puppet service so it will work with passenger --- manifests/puppetmaster/debian.pp | 9 ++++++++- manifests/puppetmaster/linux.pp | 6 +++--- manifests/puppetmaster/package/base.pp | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/manifests/puppetmaster/debian.pp b/manifests/puppetmaster/debian.pp index 8cee0ea..a7d7f0a 100644 --- a/manifests/puppetmaster/debian.pp +++ b/manifests/puppetmaster/debian.pp @@ -8,12 +8,19 @@ class puppet::puppetmaster::debian inherits puppet::puppetmaster::package { } } + if $puppetmaster_mode == 'passenger' { + $puppetmaster_default_nofity = 'Exec[notify_passenger_puppetmaster]' + } + file { '/etc/default/puppetmaster': source => [ "puppet:///modules/site-puppet/master/debian/${fqdn}/puppetmaster", "puppet:///modules/site-puppet/master/debian/${domain}/puppetmaster", "puppet:///modules/site-puppet/master/debian/puppetmaster", "puppet:///modules/puppet/master/debian/puppetmaster" ], - notify => Service[puppetmaster], + notify => $puppetmaster_default_nofity ? { + '' => Service[puppetmaster], + default => Exec['notify_passenger_puppetmaster'] + }, owner => root, group => 0, mode => 0644; } } diff --git a/manifests/puppetmaster/linux.pp b/manifests/puppetmaster/linux.pp index 2670203..a5098cd 100644 --- a/manifests/puppetmaster/linux.pp +++ b/manifests/puppetmaster/linux.pp @@ -11,8 +11,8 @@ class puppet::puppetmaster::linux inherits puppet::linux { enable => true, require => [ Package[puppet] ], } - } - Service[puppet]{ - require +> Service[puppetmaster], + Service[puppet]{ + require +> Service[puppetmaster], + } } } diff --git a/manifests/puppetmaster/package/base.pp b/manifests/puppetmaster/package/base.pp index 363f827..ff8d02a 100644 --- a/manifests/puppetmaster/package/base.pp +++ b/manifests/puppetmaster/package/base.pp @@ -4,7 +4,9 @@ class puppet::puppetmaster::package::base inherits puppet::puppetmaster::package ensure => present, } - Service['puppetmaster']{ - require +> Package['puppetmaster'], + if $puppetmaster_mode != 'passenger' { + Service['puppetmaster']{ + require +> Package['puppetmaster'], + } } } -- cgit v1.2.3 From 651e870e70abd5c71616f5676d1e785bddd5ee81 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 22 Apr 2011 13:17:32 -0400 Subject: Revert "Declared the inclusion of an external package. This should be removed for public use or incorporated into the puppet module" This isn't something we want to keep This reverts commit bc4fa29b454691b6c446b2881b4b3ea39d6b8272. --- manifests/puppetmaster/passenger.pp | 1 - 1 file changed, 1 deletion(-) diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp index 0471234..c4bc062 100644 --- a/manifests/puppetmaster/passenger.pp +++ b/manifests/puppetmaster/passenger.pp @@ -3,7 +3,6 @@ class puppet::puppetmaster::passenger inherits puppet::puppetmaster::base { include ::passenger - include mod-passenger # A reference configuration is available at : # http://github.com/reductivelabs/puppet/tree/master/ext/rack -- cgit v1.2.3 From 517a06aa3f2edf36114a8e3b5202ed21be4cc4e7 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 22 Apr 2011 16:45:50 -0400 Subject: fix problem where you are not on wheezy or sid, but you install a newer version through puppetmaster_ensure_version (such as through backports) --- manifests/puppetmaster/package/debian.pp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 4c4f68b..27b64b1 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -1,13 +1,21 @@ class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package::base { - if !$puppetmaster_ensure_version { $puppetmaster_ensure_version = 'installed' } - case $lsbdistcodename { + if !$puppetmaster_ensure_version { + $puppetmaster_ensure_version = 'installed' + case $lsbdistcodename { wheezy,sid: { $puppetmaster_common_required = 'puppetmaster-common' $puppetmaster_common_ensure = $puppetmaster_ensure_version } + default: { + if (versioncmp($puppetmaster_ensure_version, "2.6.7") >= 0) { + $puppetmaster_common_requred = 'puppetmaster-common' + $puppetmaster_common_ensure = $puppetmaster_ensure_version + } + } + } } - + Package["puppetmaster"]{ require => $puppetmaster_common_required ? { '' => undef, -- cgit v1.2.3 From 45acc8df306666f1eaa033e519b24e261dcca7b0 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 7 May 2011 20:10:46 +0200 Subject: Inherit from the right base class. --- manifests/puppetmaster/package/debian.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 33d7d5e..39feced 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -1,4 +1,4 @@ -class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package { +class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package::base { Package['puppetmaster']{ require => Package['puppetmaster-common'] -- cgit v1.2.3 From f37df509cf1ea3edafd4e60eaa349add9ae19e63 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 7 May 2011 20:15:34 +0200 Subject: Install puppetmaster-common package. This should fix the remaining issues from https://labs.riseup.net/code/issues/2928 --- manifests/puppetmaster/package/debian.pp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 39feced..9d7d397 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -1,5 +1,9 @@ class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package::base { + package { 'puppetmaster-common': + ensure => present, + } + Package['puppetmaster']{ require => Package['puppetmaster-common'] } -- cgit v1.2.3 From 34fbca2af14bfc3bda4641c6c36e144d5229f8c1 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 7 May 2011 20:37:08 +0200 Subject: Fix probable typos. --- manifests/puppetmaster.pp | 2 +- manifests/puppetmaster/base.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 6ac1e0c..25709ea 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'], } -- cgit v1.2.3 From ca67c706f3bd15e332fc68b1c53a21ccde9a90f1 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Sat, 21 May 2011 10:32:03 +0200 Subject: Fix development environment's modules path. --- files/master/puppet.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/master/puppet.conf b/files/master/puppet.conf index 6b4b0e9..cf50317 100644 --- a/files/master/puppet.conf +++ b/files/master/puppet.conf @@ -63,7 +63,7 @@ # configure environments [development] manifest=$vardir/development/etc/manifests/site.pp - modulepath=$vardir/development/manifests + modulepath=$vardir/development/modules/ templatepath=$vardir/development/templates/ [production] -- cgit v1.2.3 From 05331a27858cd6c199acc4ffbe694592e2c40e74 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 00:30:42 +0200 Subject: also don't do anything on undef - maybe once puppet will return undef on undefined variables --- manifests/base.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/base.pp b/manifests/base.pp index 69a7568..695241c 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -6,7 +6,7 @@ class puppet::base { case $puppet_cleanup_clientbucket { # if not set, don't do anything - '': {} + '',undef: {} default: { tidy { "/var/lib/puppet/clientbucket": backup => false, -- cgit v1.2.3 From 0f4718f062f7419092f69dcdd951339a466a79b8 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 00:52:08 +0200 Subject: migrate cleanup_reports to parametrized classes as this makes it much more configurable --- README | 17 +++++++++++++---- manifests/puppetmaster.pp | 10 ++-------- manifests/puppetmaster/cleanup_reports.pp | 19 ++++++++++++++----- manifests/puppetmaster/cleanup_reports/disable.pp | 6 ------ 4 files changed, 29 insertions(+), 23 deletions(-) delete mode 100644 manifests/puppetmaster/cleanup_reports/disable.pp diff --git a/README b/README index 2063b03..69e5928 100644 --- a/README +++ b/README @@ -62,11 +62,20 @@ Reports cleanup: --------------- By default we clean up reports older than 30 days. If you want to change -that, you can set $puppetmaster_cleanup_reports to one of the following -values: +that, you can subclass puppet::puppetmaster and overwrite the included class and +include that one instead: + +class mypuppetmaster inherits puppet::master { + Class['puppet::puppetmaster::cleanup_reports']{ + cleanup_older_than => 'absent' + } +} + +Where 'absent' means not to cleanup records and X any other amount of days. + +You can also adjust the locations of the reports to your needs, by setting the param +`reports_dir` to something different. -* 'X', where X is the amount of days you want to keep reports for -* false, to disable reports cleanup Check last run: --------------- diff --git a/manifests/puppetmaster.pp b/manifests/puppetmaster.pp index 3e8711c..55e1dab 100644 --- a/manifests/puppetmaster.pp +++ b/manifests/puppetmaster.pp @@ -29,14 +29,8 @@ class puppet::puppetmaster inherits puppet { include puppet::puppetmaster::cluster } - case $puppetmaster_cleanup_reports { - '': { $puppetmaster_cleanup_reports = '30' } - } - - if $puppetmaster_cleanup_reports { - include puppet::puppetmaster::cleanup_reports - } else { - include puppet::puppetmaster::cleanup_reports::disable + class{'puppet::puppetmaster::cleanup_reports': + cleanup_older_than => '30', } if $use_shorewall { diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index 664bd81..d25e8ac 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -1,8 +1,17 @@ -class puppet::puppetmaster::cleanup_reports { +class puppet::puppetmaster::cleanup_reports( + $cleanup_older_than = 'absent', + $reports_dir = '/var/lib/puppet/reports/' +){ + file { '/etc/cron.daily/puppet_reports_cleanup.sh': } - # clean up reports older than $puppetmaster_cleanup_reports days - file { '/etc/cron.daily/puppet_reports_cleanup.sh': - content => "#!/bin/bash\nfind /var/lib/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", - owner => root, group => 0, mode => 0700; + if $cleanup_older_than != 'absent' { + File['/etc/cron.daily/puppet_reports_cleanup.sh']{ + content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", + owner => root, group => 0, mode => 0700, + } + } else { + File['/etc/cron.daily/puppet_reports_cleanup.sh']{ + ensure => absent, + } } } diff --git a/manifests/puppetmaster/cleanup_reports/disable.pp b/manifests/puppetmaster/cleanup_reports/disable.pp deleted file mode 100644 index 8636223..0000000 --- a/manifests/puppetmaster/cleanup_reports/disable.pp +++ /dev/null @@ -1,6 +0,0 @@ -class puppet::puppetmaster::cleanup_reports::disable inherits puppet::puppetmaster::cleanup_reports { - - File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - ensure => absent, - } -} -- cgit v1.2.3 From 0fd0df89f4a0bd0700b3260a4c40041c59f65660 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:04:20 +0200 Subject: fix variable naming --- manifests/puppetmaster/cleanup_reports.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index d25e8ac..d9bd2ca 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -6,7 +6,7 @@ class puppet::puppetmaster::cleanup_reports( if $cleanup_older_than != 'absent' { File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", + content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_older_than} -exec rm {} \\;\n", owner => root, group => 0, mode => 0700, } } else { -- cgit v1.2.3 From 551b46b257b12b32450607083a7cd644ed0dff58 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:21:00 +0200 Subject: Revert "fix variable naming" This reverts commit 0fd0df89f4a0bd0700b3260a4c40041c59f65660. --- manifests/puppetmaster/cleanup_reports.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index d9bd2ca..d25e8ac 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -6,7 +6,7 @@ class puppet::puppetmaster::cleanup_reports( if $cleanup_older_than != 'absent' { File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_older_than} -exec rm {} \\;\n", + content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", owner => root, group => 0, mode => 0700, } } else { -- cgit v1.2.3 From 9a18424b2bdf3506737a28ca56a25e20950d6d68 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:21:06 +0200 Subject: Revert "migrate cleanup_reports to parametrized classes as this makes it much more configurable" This reverts commit 0f4718f062f7419092f69dcdd951339a466a79b8. Unfortuantely due to puppet bug #5517 we currently can't do it that nice so we need to hack around things https://projects.puppetlabs.com/issues/5517 --- README | 17 ++++------------- manifests/puppetmaster.pp | 10 ++++++++-- manifests/puppetmaster/cleanup_reports.pp | 19 +++++-------------- manifests/puppetmaster/cleanup_reports/disable.pp | 6 ++++++ 4 files changed, 23 insertions(+), 29 deletions(-) create mode 100644 manifests/puppetmaster/cleanup_reports/disable.pp diff --git a/README b/README index 69e5928..2063b03 100644 --- a/README +++ b/README @@ -62,20 +62,11 @@ Reports cleanup: --------------- By default we clean up reports older than 30 days. If you want to change -that, you can subclass puppet::puppetmaster and overwrite the included class and -include that one instead: - -class mypuppetmaster inherits puppet::master { - Class['puppet::puppetmaster::cleanup_reports']{ - cleanup_older_than => 'absent' - } -} - -Where 'absent' means not to cleanup records and X any other amount of days. - -You can also adjust the locations of the reports to your needs, by setting the param -`reports_dir` to something different. +that, you can set $puppetmaster_cleanup_reports to one of the following +values: +* 'X', where X is the amount of days you want to keep reports for +* false, to disable reports cleanup Check last run: --------------- diff --git a/manifests/puppetmaster.pp b/manifests/puppetmaster.pp index 55e1dab..3e8711c 100644 --- a/manifests/puppetmaster.pp +++ b/manifests/puppetmaster.pp @@ -29,8 +29,14 @@ class puppet::puppetmaster inherits puppet { include puppet::puppetmaster::cluster } - class{'puppet::puppetmaster::cleanup_reports': - cleanup_older_than => '30', + case $puppetmaster_cleanup_reports { + '': { $puppetmaster_cleanup_reports = '30' } + } + + if $puppetmaster_cleanup_reports { + include puppet::puppetmaster::cleanup_reports + } else { + include puppet::puppetmaster::cleanup_reports::disable } if $use_shorewall { diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index d25e8ac..664bd81 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -1,17 +1,8 @@ -class puppet::puppetmaster::cleanup_reports( - $cleanup_older_than = 'absent', - $reports_dir = '/var/lib/puppet/reports/' -){ - file { '/etc/cron.daily/puppet_reports_cleanup.sh': } +class puppet::puppetmaster::cleanup_reports { - if $cleanup_older_than != 'absent' { - File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - content => "#!/bin/bash\nfind ${puppet::puppetmaster::cleanup_reports::reports_dir} -maxdepth 2 -type f -ctime +${puppet::puppetmaster::cleanup_reports::cleanup_olderthan} -exec rm {} \\;\n", - owner => root, group => 0, mode => 0700, - } - } else { - File['/etc/cron.daily/puppet_reports_cleanup.sh']{ - ensure => absent, - } + # clean up reports older than $puppetmaster_cleanup_reports days + file { '/etc/cron.daily/puppet_reports_cleanup.sh': + content => "#!/bin/bash\nfind /var/lib/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", + owner => root, group => 0, mode => 0700; } } diff --git a/manifests/puppetmaster/cleanup_reports/disable.pp b/manifests/puppetmaster/cleanup_reports/disable.pp new file mode 100644 index 0000000..8636223 --- /dev/null +++ b/manifests/puppetmaster/cleanup_reports/disable.pp @@ -0,0 +1,6 @@ +class puppet::puppetmaster::cleanup_reports::disable inherits puppet::puppetmaster::cleanup_reports { + + File['/etc/cron.daily/puppet_reports_cleanup.sh']{ + ensure => absent, + } +} -- cgit v1.2.3 From b3dc59ba25d05529936736297334ce86b402445f Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:24:29 +0200 Subject: implement setting reports cleanup dir the old way --- README | 3 +++ manifests/puppetmaster/cleanup_reports.pp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README b/README index 2063b03..ff74b2d 100644 --- a/README +++ b/README @@ -68,6 +68,9 @@ values: * 'X', where X is the amount of days you want to keep reports for * false, to disable reports cleanup +If your reports are in a different place than the default, you can set +$puppetmaster_reports dir to adjust their location. + Check last run: --------------- diff --git a/manifests/puppetmaster/cleanup_reports.pp b/manifests/puppetmaster/cleanup_reports.pp index 664bd81..005a4d7 100644 --- a/manifests/puppetmaster/cleanup_reports.pp +++ b/manifests/puppetmaster/cleanup_reports.pp @@ -1,8 +1,8 @@ class puppet::puppetmaster::cleanup_reports { - + case $puppetmaster_reports_dir { '',undef: { $puppetmaster_reports_dir = '/var/lib/puppet/reports' } } # clean up reports older than $puppetmaster_cleanup_reports days file { '/etc/cron.daily/puppet_reports_cleanup.sh': - content => "#!/bin/bash\nfind /var/lib/puppet/reports/ -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", + content => "#!/bin/bash\nfind ${puppetmaster_reports_dir} -maxdepth 2 -type f -ctime +${puppetmaster_cleanup_reports} -exec rm {} \\;\n", owner => root, group => 0, mode => 0700; } } -- cgit v1.2.3 From 02d3c6ec11c441a5ab59a5ca001afd6a3f449933 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:29:51 +0200 Subject: README typo --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index ff74b2d..3c71a5f 100644 --- a/README +++ b/README @@ -69,7 +69,7 @@ values: * false, to disable reports cleanup If your reports are in a different place than the default, you can set -$puppetmaster_reports dir to adjust their location. +$puppetmaster_reports_dir to adjust their location. Check last run: --------------- -- cgit v1.2.3 From af97bf0e96167e916e36110eb858f257ccf083e6 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 7 Jul 2011 01:45:57 +0200 Subject: linux is the kernel not the operating system --- manifests/cron.pp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/manifests/cron.pp b/manifests/cron.pp index 693a430..5f9f227 100644 --- a/manifests/cron.pp +++ b/manifests/cron.pp @@ -1,10 +1,12 @@ -# manifests/cron.pp - class puppet::cron inherits puppet { case $operatingsystem { - linux: { include puppet::cron::linux } debian: { include puppet::cron::debian } openbsd: { include puppet::cron::openbsd } - default: { include puppet::cron::base } + default: { + case $kernel { + linux: { include puppet::cron::linux } + default: { include puppet::cron::base } + } + } } } -- cgit v1.2.3 From c813c09f282afb879399fc21ed990767d4aff64f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Thu, 5 Apr 2012 14:20:29 -0400 Subject: determine if puppetmaster-common should be installed, if $puppetmaster_ensure_version is not set --- manifests/puppetmaster/package/debian.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 27b64b1..01b7f79 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -25,7 +25,7 @@ class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::packa } package { "puppetmaster-common": - ensure => $puppetmaster_common_ensure ? { + ensure => $puppetmaster_common_required ? { '' => absent, default => $puppetmaster_common_ensure }, -- cgit v1.2.3 From 06942f75f03b5c8a78c8b3a9f466bf72b1b34f5c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 11 Apr 2012 18:46:53 -0400 Subject: implement fix for cron file being put in place even when you do not include puppet::cron. The module should make sure that the cron file is not there if you aren't using the cron method, otherwise the daemon and the cronjob could both run. Used suggested change from jcharaoui in #3513 --- manifests/cron/linux.pp | 1 + manifests/linux.pp | 1 + 2 files changed, 2 insertions(+) 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 } } -- cgit v1.2.3 From dd380fa91507155d5cfe8ea87023903eb91a18b0 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 27 Jun 2012 22:58:41 -0400 Subject: 2.7 underscore rename: site-puppet --- README | 14 +++++++------- manifests/base.pp | 6 +++--- manifests/centos.pp | 6 +++--- manifests/debian.pp | 6 +++--- manifests/linux.pp | 2 +- manifests/puppetmaster/base.pp | 8 ++++---- manifests/puppetmaster/centos.pp | 6 +++--- manifests/puppetmaster/debian.pp | 6 +++--- manifests/puppetmaster/passenger.pp | 2 +- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README b/README index 3c71a5f..ea07f0a 100644 --- a/README +++ b/README @@ -1,10 +1,10 @@ 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 +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 + site_puppet/files/master/fileserver.conf + site_puppet/files/master/puppet.conf Usage ===== @@ -95,7 +95,7 @@ $puppet_storeconfig_password to the puppet database password, and then set $puppetmaster_storeconfigs = true to enable stored configs. Then you will need to either put in your node definition, or in -site-puppet/manifests/init.pp puppet::puppetmaster::hasdb to setup the database +site_puppet/manifests/init.pp puppet::puppetmaster::hasdb to setup the database with the right parameters. This will setup your storeconfigs database, adding to the database the correct user, the correct grant permissions, and also setup a munin graph, if you have $use_munin = true @@ -115,14 +115,14 @@ node puppetmaster { $use_munin = true $puppetmaster_mode = 'passenger' $puppet_crontime = "0,12 * * * *" - include site-puppet::master + include site_puppet::master include puppet::cron include puppet::puppetmaster ... -in your site-puppet/manifests/master.pp you could include something like: +in your site_puppet/manifests/master.pp you could include something like: -class site-puppet::master { +class site_puppet::master { ... puppet::puppetmaster::hasdb { "puppet": dbname => 'puppetmaster', diff --git a/manifests/base.pp b/manifests/base.pp index 695241c..6ff8fa5 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -20,9 +20,9 @@ class puppet::base { file { 'puppet_config': path => "$puppet_config", - source => [ "puppet:///modules/site-puppet/client/${fqdn}/puppet.conf", - "puppet:///modules/site-puppet/client/puppet.conf.$operatingsystem", - "puppet:///modules/site-puppet/client/puppet.conf", + source => [ "puppet:///modules/site_puppet/client/${fqdn}/puppet.conf", + "puppet:///modules/site_puppet/client/puppet.conf.$operatingsystem", + "puppet:///modules/site_puppet/client/puppet.conf", "puppet:///modules/puppet/client/${puppet_majorversion}/puppet.conf.$operatingsystem", "puppet:///modules/puppet/client/${puppet_majorversion}/puppet.conf", "puppet:///modules/puppet/client/puppet.conf.$operatingsystem", diff --git a/manifests/centos.pp b/manifests/centos.pp index 61aa065..d98f422 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -1,9 +1,9 @@ class puppet::centos inherits puppet::linux { file { '/etc/sysconfig/puppet': - source => [ "puppet:///modules/site-puppet/sysconfig/${fqdn}/puppet", - "puppet:///modules/site-puppet/sysconfig/${domain}/puppet", - "puppet:///modules/site-puppet/sysconfig/puppet", + source => [ "puppet:///modules/site_puppet/sysconfig/${fqdn}/puppet", + "puppet:///modules/site_puppet/sysconfig/${domain}/puppet", + "puppet:///modules/site_puppet/sysconfig/puppet", "puppet:///modules/puppet/sysconfig/puppet" ], notify => Service[puppet], owner => root, group => 0, mode => 0644; diff --git a/manifests/debian.pp b/manifests/debian.pp index f0479ae..e0cf4bc 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -1,9 +1,9 @@ class puppet::debian inherits puppet::linux { file { '/etc/default/puppet': - source => [ "puppet:///modules/site-puppet/client/debian/${fqdn}/puppet", - "puppet:///modules/site-puppet/client/debian/${domain}/puppet", - "puppet:///modules/site-puppet/client/debian/puppet", + source => [ "puppet:///modules/site_puppet/client/debian/${fqdn}/puppet", + "puppet:///modules/site_puppet/client/debian/${domain}/puppet", + "puppet:///modules/site_puppet/client/debian/puppet", "puppet:///modules/puppet/client/debian/puppet" ], notify => Service[puppet], owner => root, group => 0, mode => 0644; diff --git a/manifests/linux.pp b/manifests/linux.pp index 13788ef..d17b386 100644 --- a/manifests/linux.pp +++ b/manifests/linux.pp @@ -15,7 +15,7 @@ class puppet::linux inherits puppet::base { } file { '/etc/cron.d/puppetd.cron': - source => [ "puppet:///modules/site-puppet/cron.d/puppetd", + source => [ "puppet:///modules/site_puppet/cron.d/puppetd", "puppet:///modules/puppet/cron.d/puppetd.${operatingsystem}", "puppet:///modules/puppet/cron.d/puppetd" ], owner => root, group => 0, mode => 0644, diff --git a/manifests/puppetmaster/base.pp b/manifests/puppetmaster/base.pp index a7dc7a5..a313ff2 100644 --- a/manifests/puppetmaster/base.pp +++ b/manifests/puppetmaster/base.pp @@ -2,8 +2,8 @@ class puppet::puppetmaster::base inherits puppet::base { File[puppet_config]{ source => [ - "puppet:///modules/site-puppet/master/${fqdn}/puppet.conf", - "puppet:///modules/site-puppet/master/puppet.conf", + "puppet:///modules/site_puppet/master/${fqdn}/puppet.conf", + "puppet:///modules/site_puppet/master/puppet.conf", "puppet:///modules/puppet/master/puppet.conf", ], } @@ -11,8 +11,8 @@ class puppet::puppetmaster::base inherits puppet::base { if !$puppet_fileserverconfig { $puppet_fileserverconfig = "${puppet::default_config_dir}/fileserver.conf" } file { "$puppet_fileserverconfig": - source => [ "puppet:///modules/site-puppet/master/${fqdn}/fileserver.conf", - "puppet:///modules/site-puppet/master/fileserver.conf", + source => [ "puppet:///modules/site_puppet/master/${fqdn}/fileserver.conf", + "puppet:///modules/site_puppet/master/fileserver.conf", "puppet:///modules/puppet/master/fileserver.conf" ], owner => root, group => puppet, mode => 640; } diff --git a/manifests/puppetmaster/centos.pp b/manifests/puppetmaster/centos.pp index 2673a4d..a6f5e23 100644 --- a/manifests/puppetmaster/centos.pp +++ b/manifests/puppetmaster/centos.pp @@ -2,9 +2,9 @@ class puppet::puppetmaster::centos inherits puppet::puppetmaster::package { file { '/etc/sysconfig/puppetmaster': - source => [ "puppet:///modules/site-puppet/sysconfig/${fqdn}/puppetmaster", - "puppet:///modules/site-puppet/sysconfig/${domain}/puppetmaster", - "puppet:///modules/site-puppet/sysconfig/puppetmaster", + source => [ "puppet:///modules/site_puppet/sysconfig/${fqdn}/puppetmaster", + "puppet:///modules/site_puppet/sysconfig/${domain}/puppetmaster", + "puppet:///modules/site_puppet/sysconfig/puppetmaster", "puppet:///modules/puppet/sysconfig/puppetmaster" ], notify => Service[puppetmaster], owner => root, group => 0, mode => 0644; diff --git a/manifests/puppetmaster/debian.pp b/manifests/puppetmaster/debian.pp index a7d7f0a..0c81a64 100644 --- a/manifests/puppetmaster/debian.pp +++ b/manifests/puppetmaster/debian.pp @@ -13,9 +13,9 @@ class puppet::puppetmaster::debian inherits puppet::puppetmaster::package { } file { '/etc/default/puppetmaster': - source => [ "puppet:///modules/site-puppet/master/debian/${fqdn}/puppetmaster", - "puppet:///modules/site-puppet/master/debian/${domain}/puppetmaster", - "puppet:///modules/site-puppet/master/debian/puppetmaster", + source => [ "puppet:///modules/site_puppet/master/debian/${fqdn}/puppetmaster", + "puppet:///modules/site_puppet/master/debian/${domain}/puppetmaster", + "puppet:///modules/site_puppet/master/debian/puppetmaster", "puppet:///modules/puppet/master/debian/puppetmaster" ], notify => $puppetmaster_default_nofity ? { '' => Service[puppetmaster], diff --git a/manifests/puppetmaster/passenger.pp b/manifests/puppetmaster/passenger.pp index c4bc062..584a559 100644 --- a/manifests/puppetmaster/passenger.pp +++ b/manifests/puppetmaster/passenger.pp @@ -13,7 +13,7 @@ class puppet::puppetmaster::passenger inherits puppet::puppetmaster::base { owner => root, group => 0, mode => 0755; '/etc/puppet/rack/config.ru': - source => [ "puppet:///modules/site-puppet/master/config.ru", + source => [ "puppet:///modules/site_puppet/master/config.ru", "puppet:///modules/puppet/master/config.ru" ], owner => puppet, group => 0, mode => 0644; } -- cgit v1.2.3 From 0d7241bc0849be42e365b65e9bfaad984029fdbf Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 14:15:36 -0400 Subject: add information to README about specifying versions --- README | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README b/README index ea07f0a..cf068ee 100644 --- a/README +++ b/README @@ -12,6 +12,18 @@ Usage The module currently looks for values on different variables to adjust configuration of the master. +Installing a specific versions +------------------------------ + +If you need to install a different version of puppet, other than the most recent, +you can set the following variable: + +$puppet_ensure_version = '2.7.18-1~bpo60+1' + +You can also specify a different facter version by setting the following variable: + +$facter_ensure_version = '1.6.9-2~bpo60+2' + Run puppet by cron: ------------------- @@ -49,6 +61,13 @@ mode, you can set $puppetmaster_mode either to: In both cases you have to setup the appropriate frontends (apache vhost configuration/nginx vhost configuration) on your own. +If you need to install a specific version of puppetmaster, you can specify the +version to be installed by doing the following: + +$puppetmaster_ensure_version = '2.7.18-1~bpo60+1' + +NOTE: You will need the apt module in order to specify the puppetmaster version. + Munin ----- -- cgit v1.2.3 From c5f6f891cf4ea2e804f409db0a33515469568e3e Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 14:15:50 -0400 Subject: minor README language fix --- README | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README b/README index cf068ee..b0d8e2e 100644 --- a/README +++ b/README @@ -9,8 +9,8 @@ files, under: Usage ===== -The module currently looks for values on different variables to adjust -configuration of the master. +The module currently looks for different variable values to adjust configuration +of the master. Installing a specific versions ------------------------------ -- cgit v1.2.3 From 0e6eab4d0c31f358bdca76eed7001846a9afae4c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 14:16:43 -0400 Subject: update puppet.conf default file to have the newer section headings, required to eliminate deprecation warnings --- files/master/puppet.conf | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/files/master/puppet.conf b/files/master/puppet.conf index fcaef0d..f6471d7 100644 --- a/files/master/puppet.conf +++ b/files/master/puppet.conf @@ -20,7 +20,7 @@ factpath = $vardir/lib/facter plugindest = $vardir/lib/puppet -[puppetd] +[agent] # The file in which puppetd stores a list of the classes # associated with the retrieved configuratiion. Can be loaded in # the separate ``puppet`` executable using the ``--loadclasses`` @@ -35,11 +35,10 @@ report=true pluginsync = true - factsync=true logdest=/var/log/puppet/puppet.log -[puppetmasterd] +[master] reportdir = $logdir/reports autoflush = true #storeconfigs=true -- cgit v1.2.3 From 2a83aea970a8348fedeee2109d6d530a7e73a39b Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 14:17:08 -0400 Subject: we must fully qualify paths to execs --- manifests/puppetmaster/linux.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/puppetmaster/linux.pp b/manifests/puppetmaster/linux.pp index a5098cd..ebf183b 100644 --- a/manifests/puppetmaster/linux.pp +++ b/manifests/puppetmaster/linux.pp @@ -3,7 +3,7 @@ class puppet::puppetmaster::linux inherits puppet::linux { if $puppetmaster_mode == 'passenger' { exec { 'notify_passenger_puppetmaster': refreshonly => true, - command => 'touch /etc/puppet/rack/tmp/restart.txt && sleep 1 && rm /etc/puppet/rack/tmp/restart.txt', + command => '/usr/bin/touch /etc/puppet/rack/tmp/restart.txt && sleep 1 && /bin/rm /etc/puppet/rack/tmp/restart.txt', } } else { service { 'puppetmaster': -- cgit v1.2.3 From 392db0c4e46f77c88f551215cd00719bc7c45b24 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 14:21:26 -0400 Subject: add apt::preferences::snippet to enable specifying the puppetmaster version. The preferences snippet requires that we set the package parameter to 'puppet*' to pull in the correct dependencies. We set the priority to 2000 because according to apt_preferences(5): P > 1000 causes a version to be installed even if this constitutes a downgrade of the package which is the desired behavior. This should resolve issue #2928 --- manifests/puppetmaster/package/debian.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index 01b7f79..eca55e9 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -15,6 +15,14 @@ class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::packa } } } + else { + apt::preferences_snippet { + 'puppet_passenger': + package => 'puppet*', + pin => "version $puppetmaster_ensure_version", + priority => 2000; + } + } Package["puppetmaster"]{ require => $puppetmaster_common_required ? { @@ -23,11 +31,11 @@ class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::packa }, ensure => $puppetmaster_ensure_version, } - + package { "puppetmaster-common": ensure => $puppetmaster_common_required ? { '' => absent, - default => $puppetmaster_common_ensure + default => installed }, } } -- cgit v1.2.3 From 47808ed4f4a446ed48b448d72e820ca60e05776c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 14:22:31 -0400 Subject: update config.ru to newer version as supplied by puppetlabs for passenger applications. This is likely not to work with older versions of passenger --- files/master/config.ru | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/files/master/config.ru b/files/master/config.ru index cec2a34..b0fd250 100644 --- a/files/master/config.ru +++ b/files/master/config.ru @@ -4,26 +4,28 @@ # 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") +$0 = "master" # if you want debugging: -#ARGV << "--debug" +# 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" -# if you use puppet-dashboard: -#ARGV << "--reports" << "puppet_dashboard" +# NOTE: it's unfortunate that we have to use the "CommandLine" class +# here to launch the app, but it contains some initialization logic +# (such as triggering the parsing of the config file) that is very +# important. We should do something less nasty here when we've +# gotten our API and settings initialization logic cleaned up. +# +# Also note that the "$0 = master" line up near the top here is +# the magic that allows the CommandLine class to know that it's +# supposed to be running master. +# +# --cprice 2012-05-22 -require 'puppet/application/puppetmasterd' +require 'puppet/util/command_line' # we're usually running inside a Rack::Builder.new {} block, # therefore we need to call run *here*. -run Puppet::Application[:puppetmasterd].run +run Puppet::Util::CommandLine.new.execute + -- cgit v1.2.3 From f1a6bc15299fd07022805eb941112495bc64c5e4 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 15:07:00 -0400 Subject: remove unnecessary inheritance of puppet::puppetmaster::package to puppet::puppetmaster::linux provide a warning message if you have tried to specify $puppetmaster_ensure_version on an operatingsystem that is not supported --- manifests/puppetmaster/package.pp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/manifests/puppetmaster/package.pp b/manifests/puppetmaster/package.pp index 145792e..aef3121 100644 --- a/manifests/puppetmaster/package.pp +++ b/manifests/puppetmaster/package.pp @@ -1,9 +1,17 @@ # manifests/puppetmaster/package.pp -class puppet::puppetmaster::package inherits puppet::puppetmaster::linux { +class puppet::puppetmaster::package { case $operatingsystem { - centos: { include puppet::puppetmaster::package::centos } + centos: { + if $puppetmaster_ensure_version { + warn('$puppetmaster_ensure_version is not supported for this operatingsystem') + } + include puppet::puppetmaster::package::centos } debian: { include puppet::puppetmaster::package::debian } - default: { include puppet::puppetmaster::package::base } + default: { + if $puppetmaster_ensure_version { + warn('$puppetmaster_ensure_version is not supported for this operatingsystem') + } + include puppet::puppetmaster::package::base } } } -- cgit v1.2.3 From 25c8e401004e15fbb15faa5dec7f6bb62aee0e8a Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 15:09:04 -0400 Subject: remove the complicated test case for determining if 'puppetmaster-common' is needed or not, this is handled by the apt::preferences_snippet and debian's package dependency resolution now stop inheriting puppet::master::package::base from puppet::puppetmaster::package::debian, it is no longer needed, because we are no longer overriding anything --- manifests/puppetmaster/package/debian.pp | 48 +++++++------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/manifests/puppetmaster/package/debian.pp b/manifests/puppetmaster/package/debian.pp index eca55e9..cea7ac4 100644 --- a/manifests/puppetmaster/package/debian.pp +++ b/manifests/puppetmaster/package/debian.pp @@ -1,41 +1,13 @@ -class puppet::puppetmaster::package::debian inherits puppet::puppetmaster::package::base { +class puppet::puppetmaster::package::debian { - if !$puppetmaster_ensure_version { - $puppetmaster_ensure_version = 'installed' - case $lsbdistcodename { - wheezy,sid: { - $puppetmaster_common_required = 'puppetmaster-common' - $puppetmaster_common_ensure = $puppetmaster_ensure_version - } - default: { - if (versioncmp($puppetmaster_ensure_version, "2.6.7") >= 0) { - $puppetmaster_common_requred = 'puppetmaster-common' - $puppetmaster_common_ensure = $puppetmaster_ensure_version - } - } - } - } - else { - apt::preferences_snippet { - 'puppet_passenger': - package => 'puppet*', - pin => "version $puppetmaster_ensure_version", - priority => 2000; - } - } - - Package["puppetmaster"]{ - require => $puppetmaster_common_required ? { - '' => undef, - default => Package["$puppetmaster_common_required"] - }, - ensure => $puppetmaster_ensure_version, - } - - package { "puppetmaster-common": - ensure => $puppetmaster_common_required ? { - '' => absent, - default => installed - }, + include puppet::puppetmaster::package::base + + apt::preferences_snippet { + 'puppet_passenger': + package => 'puppet*', + pin => "version $puppetmaster_ensure_version", + priority => 2000, + notify => Exec['refresh_apt'], + before => Package['puppetmaster']; } } -- cgit v1.2.3 From e761d31212a340a4c54f76d6308c42f569d4046d Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 15:10:26 -0400 Subject: remove no longer needed inheritance of puppet::puppetmaster::package as we are not doing any overrides, instead we can just include the classes that we also want to load --- manifests/puppetmaster/debian.pp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/puppetmaster/debian.pp b/manifests/puppetmaster/debian.pp index 0c81a64..f440ba3 100644 --- a/manifests/puppetmaster/debian.pp +++ b/manifests/puppetmaster/debian.pp @@ -1,5 +1,8 @@ -class puppet::puppetmaster::debian inherits puppet::puppetmaster::package { +class puppet::puppetmaster::debian { + include puppet::puppetmaster::package + include puppet::puppetmaster::linux + if $puppetmaster_mode != 'passenger' { case $lsbdistcodename { squeeze,sid: { -- cgit v1.2.3 From ed7d89163385a6eab4423aae7ce8b5d994339a2f Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Mon, 16 Jul 2012 15:10:47 -0400 Subject: update README to specify that the $puppetmaster_ensure_version only works for debian --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index b0d8e2e..6fd494e 100644 --- a/README +++ b/README @@ -67,6 +67,7 @@ version to be installed by doing the following: $puppetmaster_ensure_version = '2.7.18-1~bpo60+1' NOTE: You will need the apt module in order to specify the puppetmaster version. +Also, this functionality is only implemented for Debian and derived distributions. Munin ----- -- cgit v1.2.3