diff --git a/manifests/service.pp b/manifests/service.pp index 91773612b..b14e6c6d4 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -14,4 +14,9 @@ hasrestart => true, } } + + if $::operatingsystem == 'Solaris' { + contain '::puppet_agent::service::solaris' + Service[$::puppet_agent::service_names] -> Class['::puppet_agent::service::solaris'] + } } diff --git a/manifests/service/solaris.pp b/manifests/service/solaris.pp new file mode 100644 index 000000000..507bf0796 --- /dev/null +++ b/manifests/service/solaris.pp @@ -0,0 +1,17 @@ +# == Class puppet_agent::service::solaris +# +# This class tidies up the pe-puppet and pe-mcollective services +# which are left running after package removal on Solaris 10. +# +class puppet_agent::service::solaris { + assert_private() + + if $::operatingsystem == 'Solaris' and $::operatingsystemmajrelease == '10' { + service { 'pe-mcollective': + ensure => stopped, + } + service { 'pe-puppet': + ensure => stopped, + } + } +} diff --git a/spec/classes/puppet_agent_osfamily_solaris_spec.rb b/spec/classes/puppet_agent_osfamily_solaris_spec.rb index d180c3a98..d33679990 100644 --- a/spec/classes/puppet_agent_osfamily_solaris_spec.rb +++ b/spec/classes/puppet_agent_osfamily_solaris_spec.rb @@ -57,6 +57,7 @@ }) end + it { should compile.with_all_deps } it { is_expected.to contain_file('/opt/puppetlabs') } it { is_expected.to contain_file('/opt/puppetlabs/packages') } it do @@ -70,6 +71,9 @@ is_expected.to contain_exec('unzip puppet-agent-1.2.5-1.i386.pkg.gz').with_creates('/opt/puppetlabs/packages/puppet-agent-1.2.5-1.i386.pkg') end + it { is_expected.to contain_service('pe-puppet').with_ensure('stopped') } + it { is_expected.to contain_service('pe-mcollective').with_ensure('stopped') } + [ 'PUPpuppet', 'PUPaugeas',