Skip to content

Commit

Permalink
(MODULES-3994) Manage services on Puppet 4
Browse files Browse the repository at this point in the history
Previously a bug in the logic including the puppet_agent::service class
prevented it from being applied on non-PE installs using Puppet 4. Fix
it so that services are now managed for non-PE installs under Puppet 4.
  • Loading branch information
MikaelSmith committed Jan 31, 2017
1 parent 4205d16 commit 15f5660
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@

# On windows, our MSI handles the services
# On PE AIO nodes, PE Agent nodegroup is managing the services
if $::osfamily != 'windows' and (!is_pe or versioncmp($::clientversion, '4.0.0') < 0) {
if $::osfamily != 'windows' and (!$is_pe or versioncmp($::clientversion, '4.0.0') < 0) {
class { '::puppet_agent::service':
require => Class['::puppet_agent::install'],
}
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/puppet_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ def global_facts(facts, os)
it { is_expected.to contain_package('puppet-agent').with_ensure(package_version) }
end

if Puppet.version < "4.0.0" && !params[:is_pe]
it { is_expected.to contain_class('puppet_agent::service').that_requires('puppet_agent::install') }
if Puppet.version < "4.0.0" || (os !~ /sles/ && os !~ /solaris/)
it { is_expected.to contain_class('puppet_agent::service').that_requires('Class[puppet_agent::install]') }
end

if params[:service_names].nil? &&
!(facts[:osfamily] == 'Solaris' and facts[:operatingsystemmajrelease] == '11') &&
Puppet.version < "4.0.0" && !params[:is_pe]
!(facts[:osfamily] == 'Solaris' && facts[:operatingsystemmajrelease] == '11') &&
(Puppet.version < "4.0.0" || os !~ /sles/)
it { is_expected.to contain_service('puppet') }
it { is_expected.to contain_service('mcollective') }
else
Expand Down

0 comments on commit 15f5660

Please sign in to comment.