summaryrefslogtreecommitdiff
path: root/manifests/puppetmasterd.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/puppetmasterd.pp')
-rw-r--r--manifests/puppetmasterd.pp39
1 files changed, 21 insertions, 18 deletions
diff --git a/manifests/puppetmasterd.pp b/manifests/puppetmasterd.pp
index aa428d5..122f1dd 100644
--- a/manifests/puppetmasterd.pp
+++ b/manifests/puppetmasterd.pp
@@ -1,5 +1,7 @@
# handles puppetmasterd service
-class puppetmasterd {
+class puppetmasterd(
+ $main => false,
+) {
# Configuration
case $puppetmaster_servertype {
@@ -27,11 +29,11 @@ class puppetmasterd {
include puppetmaster::ca
}
- # warns that this node has a puppetmaster
- $puppetmasterd_present = true
-
# then include puppet class
- include puppetd
+ class { 'puppetd':
+ master => true,
+ main_master => $main,
+ }
# needed packages
package {
@@ -53,7 +55,10 @@ class puppetmasterd {
default: {
service { "puppetmaster":
enable => true,
- ensure => running,
+ ensure => $main ? {
+ true => running,
+ default => stopped,
+ },
hasrestart => true,
pattern => 'puppet master',
require => Package['puppetmaster'],
@@ -117,7 +122,12 @@ class puppetmasterd {
}
# update config
- class { 'puppet::master::update': }
+ class { 'puppet::master::update':
+ ensure => $main ? {
+ true => present,
+ default => absent,
+ },
+ }
# custom puppetlast command, thanks to immerda module:
# http://git.puppet.immerda.ch/?p=module-puppet.git;a=summary
@@ -126,7 +136,10 @@ class puppetmasterd {
# https://labs.riseup.net/code/issues/2515
file { "/usr/local/sbin/puppetlast":
source => "puppet:///modules/puppet/lastruncheck",
- ensure => absent,
+ ensure => $main ? {
+ true => absent,
+ default => absent,
+ },
owner => root,
group => root,
mode => 0700,
@@ -148,13 +161,3 @@ class puppetmasterd {
#}
}
-
-class puppetmasterd::disabled inherits puppetmasterd {
- Service["puppetmaster"] {
- ensure => stopped,
- }
-
- Cron["puppetlast", "puppetmaster-restart", "puppet-update"] {
- ensure => absent,
- }
-}