Showing with 454 additions and 162 deletions.
  1. +1 −2 CONTRIBUTING.md
  2. +25 −4 README.markdown
  3. +12 −3 manifests/client.pp
  4. +37 −1 manifests/init.pp
  5. +252 −131 manifests/params.pp
  6. +1 −1 metadata.json
  7. +17 −7 spec/classes/snmp_client_spec.rb
  8. +73 −9 spec/classes/snmp_init_spec.rb
  9. +12 −4 spec/defines/snmp_snmpv3_user_spec.rb
  10. +2 −0 templates/snmp.conf.erb
  11. +22 −0 templates/snmpd.conf.erb
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ normal
5. Run the tests. We only take pull requests with passing tests. `bundle exec rake spec SPEC_OPTS='--format documentation'`
6. Add or update documentation.
7. Squash your commits down into logical components. Make sure to rebase against the current `develop` branch. `git pull --rebase upstream develop`
8. Publish your featue. `git flow feature publish my-feature`
8. Publish your feature. `git flow feature publish my-feature`
9. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch against the develop branch.

Testing
Expand Down Expand Up @@ -85,4 +85,3 @@ Versioning
----------

This project is versioned with the help of the [Semantic Versioning Specification](http://semver.org/) using 0.0.1 as the initial version. Please make sure you have read the guidelines before increasing a version number either for a release or a hotfix.

29 changes: 25 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ The parameter `install_client` will be renamed to `manage_client` in version 4.0

The parameters `ro_community`, `rw_community`, `ro_network`, and `rw_network` will be removed in version 4.0.0 of this module. The snmptrapd parameter name will become `authcommunity`.

Support for Puppet 2.7 will be removed in version 4.0.0 of this module.

## Usage

Most interaction with the snmp module can be done through the main snmp class. This means you can simply toggle the parameters in `::snmp` to have most functionality of the module. Additional fuctionality can be achieved by only utilizing the `::snmp::client` class or the `::snmp::snmpv3_user` define.
Expand Down Expand Up @@ -329,7 +331,6 @@ Default: []
Safety valve. Array of lines to add to the snmpd.conf file. See http://www.net-snmp.org/docs/man/snmpd.conf.html for all options.
Default: []


##### `disable_authorization`
Disable all access control checks. (yes|no)
Default: no
Expand Down Expand Up @@ -357,7 +358,6 @@ Safety valve. Array of lines to add to the snmptrapd.conf file. See http://www
Default: []
Affects snmptrapd.conf


##### `manage_client`
Whether to install the Net-SNMP client package. (true|false)
Default: false
Expand All @@ -367,7 +367,6 @@ Safety valve. Array of lines to add to the client's global snmp.conf file. See
Default: []
Affects snmp.conf


##### `ensure`
Ensure if present or absent.
Default: present
Expand Down Expand Up @@ -432,6 +431,29 @@ Default: true
Adds the smuxpeer directive to the snmpd.conf file to allow net-snmp to talk with Dell's OpenManage.
Default: false

##### `master`
Allow setting the *master* option, typically to enable AgentX registrations.
Default: false

##### `agentx_perms`
Defines the permissions and ownership of the AgentX Unix Domain socket.
Default: none

##### `agentx_ping_interval`
This will make the subagent try and reconnect every NUM seconds to the master if it ever becomes (or starts) disconnected.
Default: none

##### `agentx_socket`
Defines the address the master agent listens at, or the subagent should connect to.
Default: none

##### `agentx_timeout`
Defines the timeout period (NUM seconds) for an AgentX request.
Default: 1

##### `agentx_retries`
Defines the number of retries for an AgentX request.
Default: 5

### Class: `snmp::client`

Expand Down Expand Up @@ -537,4 +559,3 @@ Licensed under the Apache License, Version 2.0.
[razorsedge/puppet-snmp on GitHub](https://github.com/razorsedge/puppet-snmp)

[razorsedge/snmp on Puppet Forge](https://forge.puppetlabs.com/razorsedge/snmp)

15 changes: 12 additions & 3 deletions manifests/client.pp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,18 @@
ensure => $package_ensure,
name => $package_name,
}
$req = Package['snmp-client']
} else {
$req = undef
}

if $::osfamily == 'RedHat' {
file { '/etc/snmp':
ensure => directory,
}
}

$req = $::osfamily ? {
'RedHat' => [Package['snmp-client'], File['/etc/snmp']],
'Suse' => undef,
default => Package['snmp-client'],
}

file { 'snmp.conf':
Expand Down
38 changes: 37 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@
# See http://www.net-snmp.org/docs/man/snmp.conf.html for all options.
# Default: []
#
#
# [*ensure*]
# Ensure if present or absent.
# Default: present
Expand Down Expand Up @@ -226,6 +225,32 @@
# talk with Dell's OpenManage
# Default: false
#
# [*master*]
# Include the *master* option to enable AgentX registrations.
# Default: false
#
# [*agentx_perms*]
# Defines the permissions and ownership of the AgentX Unix Domain socket.
# Default: none
#
# [*agentx_ping_interval*]
# This will make the subagent try and reconnect every NUM seconds to the
# master if it ever becomes (or starts) disconnected.
# Default: none
#
# [*agentx_socket*]
# Defines the address the master agent listens at, or the subagent should
# connect to.
# Default: none
#
# [*agentx_timeout*]
# Defines the timeout period (NUM seconds) for an AgentX request.
# Default: 1
#
# [*agentx_retries*]
# Defines the number of retries for an AgentX request.
# Default: 5
#
# === Actions:
#
# Installs the Net-SNMP daemon package, service, and configuration.
Expand Down Expand Up @@ -315,8 +340,15 @@
$template_snmptrapd = $snmp::params::template_snmptrapd,
$template_snmptrapd_sysconfig = $snmp::params::template_snmptrapd_sysconfig,
$openmanage_enable = $snmp::params::openmanage_enable,
$master = $snmp::params::master,
$agentx_perms = $snmp::params::agentx_perms,
$agentx_ping_interval = $snmp::params::agentx_ping_interval,
$agentx_socket = $snmp::params::agentx_socket,
$agentx_timeout = $snmp::params::agentx_timeout,
$agentx_retries = $snmp::params::agentx_retries,
) inherits snmp::params {
# Validate our booleans
validate_bool($master)
validate_bool($manage_client)
validate_bool($autoupgrade)
validate_bool($service_enable)
Expand Down Expand Up @@ -344,6 +376,10 @@
validate_string($template_snmptrapd)
validate_string($template_snmptrapd_sysconfig)

# Validate our numbers
validate_numeric($agentx_retries)
validate_numeric($agentx_timeout)

# Validate our regular expressions
$states = [ '^yes$', '^no$' ]
validate_re($disable_authorization, $states, '$disable_authorization must be either yes or no.')
Expand Down
Loading