diff --git a/manifests/init.pp b/manifests/init.pp index aa5b37c3a..5b8f77ecf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -25,6 +25,9 @@ # [package_version] # The package version to upgrade to. Explicitly specify the version to upgrade to, # or set to 'auto' to specify the version of the compiling master. +# [manage_service] +# A boolean to simply indicate if we should ensure the service is running. +# If not, don't touch it # [service_names] # An array of services to start, normally `puppet` and `mcollective`. # None will be started if the array is empty. @@ -97,6 +100,7 @@ $manage_repo = true, $package_name = 'puppet-agent', $package_version = undef, + $manage_service = true, $service_names = $::puppet_agent::params::service_names, $source = undef, $absolute_source = undef, @@ -194,7 +198,7 @@ # - On Windows, services are handled by the puppet-agent MSI packages themselves. # ...but outside of PE, on other platforms, we must make sure the services are restarted. We do that with the # ::puppet_agent::service class. Make sure it's applied after the install process finishes if needed: - if $::osfamily != 'windows' and (!$is_pe or versioncmp($::clientversion, '4.0.0') < 0) { + if !$is_pe or versioncmp($::clientversion, '4.0.0') < 0 { class { '::puppet_agent::service': require => Class['::puppet_agent::install'], } diff --git a/manifests/params.pp b/manifests/params.pp index 877ef1c10..b9bb0b702 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,6 +8,8 @@ if ($::osfamily == 'Solaris' and $::operatingsystemmajrelease == '11') { # Solaris 11 is a special case; it uses a custom script. $service_names = [] + } elsif $::osfamily == 'windows' { + $service_names = ['puppet'] } else { # Mcollective will be removed from this list in the service manifest if # the puppet version is >= 6.0.0 diff --git a/manifests/service.pp b/manifests/service.pp index 186282235..c0e4c4f4f 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -33,7 +33,10 @@ file { ['/var/opt/lib', '/var/opt/lib/pe-puppet', '/var/opt/lib/pe-puppet/state']: ensure => directory, } - } else { + } + + # as per class comment, this is where we actually manage the service proper. + if $::puppet_agent::manage_service { $_service_names.each |$service| { service { $service: ensure => running,