system-config/modules/snmpd/manifests/init.pp
Jeremy Stanley 3089973311 Use facter's osfamily instead of operatingsystem.
The osfamily fact is more flexible when we want to support more
GNU/Linux distributions while avoiding unnecessary code duplication.

Change-Id: Iea4c73c19e7f94df8daccf25c764b6a4539a1ea0
Reviewed-on: https://review.openstack.org/27400
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins
2013-04-25 21:37:03 +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 ($::osfamily == 'Debian') {
# 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,
}
}