2f609a7223
Parameterize the package name so that things work on multiple distros. Also, updates the snmpd module so that that the init script is written out on Ubuntu only (this is not required on RHEL). Change-Id: Id5868b85fc0a7a6057d9be16c76dad2efb834f0e Reviewed-on: https://review.openstack.org/23186 Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Khai Do <zaro0508@gmail.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
48 lines
1.1 KiB
Puppet
48 lines
1.1 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'],
|
|
File['/etc/init.d/snmpd'],
|
|
],
|
|
}
|
|
|
|
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,
|
|
}
|
|
}
|