Skip to content

Commit

Permalink
Merge branch 'feature/debian_support' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
razorsedge committed Jun 16, 2013
2 parents 3a46f4b + b087ce5 commit 58df014
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OS Support:
* RedHat family - tested on CentOS 5.8 and CentOS 6.2
* Fedora - not yet supported
* SuSE family - presently unsupported (patches welcome)
* Debian family - initial Ubuntu suport (patches welcome)
* Debian family - initial Debian & Ubuntu suport (patches welcome)
* Solaris family - presently unsupported (patches welcome)

Class documentation is available via puppetdoc.
Expand Down Expand Up @@ -52,7 +52,9 @@ Examples
Notes
-----

* Only tested on CentOS 5.8 and CentOS 6.2 x86_64.
* Only tested on CentOS 5.8, CentOS 6.2 x86_64 and Debian squeeze.
* SNMPv3 user auth is not tested on Debian.
* There is a bug on Debian squeeze of net-snmp's status script. If snmptrapd is not running the status script returns 'not running' so puppet restarts snmpd module. The following is a workaround: `class { 'snmp::server': service_hasstatus => false, }`

Issues
------
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
file { 'var-net-snmp':
ensure => 'directory',
mode => $snmp::params::varnetsnmp_perms,
owner => 'root',
group => 'root',
owner => $snmp::params::varnetsnmp_owner,
group => $snmp::params::varnetsnmp_group,
path => $snmp::params::var_net_snmp,
require => Package['snmpd'],
}
Expand Down
23 changes: 23 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

$package_name = 'net-snmp'
$service_config = '/etc/snmp/snmpd.conf'
$service_config_perms= '0644'
$service_name = 'snmpd'
if $::lsbmajdistrelease <= '5' {
$sysconfig = '/etc/sysconfig/snmpd.options'
Expand All @@ -44,6 +45,8 @@
$var_net_snmp = '/var/lib/net-snmp'
$varnetsnmp_perms = '0755'
}
$varnetsnmp_owner = 'root'
$varnetsnmp_group = 'root'

$client_package_name = 'net-snmp-utils'
$client_config = '/etc/snmp/snmp.conf'
Expand All @@ -62,10 +65,30 @@
'Ubuntu': {
$package_name = 'snmpd'
$service_config = '/etc/snmp/snmpd.conf'
$service_config_perms= '0600'
$service_name = 'snmpd'
$sysconfig = '/etc/default/snmp'
$var_net_snmp = '/var/lib/snmp'
$varnetsnmp_perms = '0700'
$varnetsnmp_owner = 'snmp'
$varnetsnmp_group = 'snmp'

$client_package_name = 'snmp'
$client_config = '/etc/snmp/snmp.conf'

$trap_service_config = '/etc/snmp/snmptrapd.conf'
$trap_service_name = 'snmptrapd'
}
'Debian': {
$package_name = 'snmpd'
$service_config = '/etc/snmp/snmpd.conf'
$service_config_perms= '0600'
$service_name = 'snmpd'
$sysconfig = '/etc/default/snmp'
$var_net_snmp = '/var/lib/snmp'
$varnetsnmp_perms = '0755'
$varnetsnmp_owner = 'snmp'
$varnetsnmp_group = 'snmp'

$client_package_name = 'snmp'
$client_config = '/etc/snmp/snmp.conf'
Expand Down
2 changes: 1 addition & 1 deletion manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@

file { 'snmpd.conf':
ensure => $file_ensure,
mode => '0644',
mode => $snmp::params::service_config_perms,
owner => 'root',
group => 'root',
path => $snmp::params::service_config,
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/snmp_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end

redhatish = ['RedHat']
debianish = ['Ubuntu']
debianish = ['Ubuntu', 'Debian']

describe 'on a supported operatingsystem, with default settings' do
redhatish.each do |os|
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/snmp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end

redhatish = ['RedHat']
debianish = ['Ubuntu']
debianish = ['Ubuntu', 'Debian']

describe 'on a supported operatingsystem, with default settings' do
redhatish.each do |os|
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/snmp_trapd_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
end

redhatish = ['RedHat']
debianish = ['Ubuntu']
debianish = ['Ubuntu', 'Debian']

describe 'on a supported operatingsystem, with default settings' do
redhatish.each do |os|
Expand Down

0 comments on commit 58df014

Please sign in to comment.