Showing with 16 additions and 7 deletions.
  1. +2 −1 Gemfile
  2. +4 −4 manifests/init.pp
  3. +1 −1 metadata.json
  4. +6 −0 spec/classes/snmp_init_spec.rb
  5. +3 −1 templates/snmptrapd.conf.erb
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ group :development, :unit_tests do
gem 'json_pure', '~> 1.8', :require => false if RUBY_VERSION =~ /^1\.8/
gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION =~ /^1\.9/
gem 'json_pure', :require => false if RUBY_VERSION =~ /^2\./
gem 'metadata-json-lint', '>= 0.0.4', :require => false
gem 'metadata-json-lint', '< 1.2.0', :require => false if RUBY_VERSION =~ /^1\./
gem 'metadata-json-lint', :require => false if RUBY_VERSION =~ /^2\./
gem 'semantic_puppet', '0.1.3', :require => false if RUBY_VERSION =~ /^1\./
gem 'semantic_puppet', :require => false if RUBY_VERSION =~ /^2\./
gem 'puppet-lint-unquoted_string-check', :require => false
Expand Down
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
# Default: [ udp:127.0.0.1:162, udp6:[::1]:162 ]
#
# [*ro_community*]
# Read-only (RO) community string or array for snmptrap daemon.
# Read-only (RO) community string or array for agent and snmptrap daemon.
# Default: public
#
# [*ro_community6*]
# Read-only (RO) community string or array for IPv6.
# Read-only (RO) community string or array for IPv6 agent.
# Default: public
#
# [*rw_community*]
# Read-write (RW) community string or array.
# Read-write (RW) community string or array agent.
# Default: none
#
# [*rw_community6*]
# Read-write (RW) community string or array for IPv6.
# Read-write (RW) community string or array for IPv6 agent.
# Default: none
#
# [*ro_network*]
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "razorsedge-snmp",
"version": "3.8.0",
"version": "3.8.1",
"author": "razorsedge",
"summary": "Simple Network Management Protocol is for monitoring network and computer equipment. Net-SNMP implements v1, v2c, and v3 on both IPv4 and IPv6.",
"license": "Apache-2.0",
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/snmp_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,12 @@
'rocommunity b 127.0.0.2',
])
end
it 'should contain File[snmptrapd.conf] with contents "a" and "b"' do
verify_contents(catalogue, 'snmptrapd.conf', [
'authCommunity log,execute,net a',
'authCommunity log,execute,net b',
])
end
end

describe 'master => true' do
Expand Down
4 changes: 3 additions & 1 deletion templates/snmptrapd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ doNotLogTraps <%= @do_not_log_traps %>
################################################################################
# ACCESS CONTROL

authCommunity log,execute,net <%= @ro_community %>
<%- [*@ro_community].compact.each do |c| -%>
authCommunity log,execute,net <%= c %>
<%- end -%>
disableAuthorization <%= @disable_authorization %>

################################################################################
Expand Down