system-config/modules/snmpd/manifests/init.pp
Dan Prince 7fa452d533 Don't require /etc/init.d/snmpd on RHEL.
Updates the snmpd module so that we don't require
/etc/init.d/snmpd to start the snmpd service. This
should fix issues running this module on RHEL.

On Ubuntu we explicitly create /etc/init.d/snmpd
and already has some resource chaining in place so
that it will conditionally run before the snpmd service
starts.

Change-Id: I480c38d26c8b423f5a8d1ddc405749c03aae19b1
Reviewed-on: https://review.openstack.org/23460
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2013-03-04 20:43:54 +00:00

45 lines
1.0 KiB
Puppet

# == Class: snmpd
#
class snmpd {
include snmpd::params
package { 'snmpd':
ensure => present,
name => $::snmpd::params::package_name,
}
service { 'snmpd':
ensure => running,
hasrestart => true,
require => File['/etc/snmp/snmpd.conf']
}
if ($::operatingsystem == 'Ubuntu') {
# This file is only needed on machines pre-precise. There is a bug in
# the previous init script versions which causes them to attempt
# snmptrapd even if it's configured not to run, and then to report
# failure.
file { '/etc/init.d/snmpd':
ensure => present,
owner => 'root',
group => 'root',
mode => '0755',
source => 'puppet:///modules/snmpd/snmpd.init',
replace => true,
require => Package['snmpd'],
}
File['/etc/init.d/snmpd'] -> Service['snmpd']
}
file { '/etc/snmp/snmpd.conf':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/snmpd/snmpd.conf',
replace => true,
}
}