Showing with 439 additions and 220 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 .puppet-lint.rc
  3. +7 −0 .sync.yml
  4. +20 −7 .travis.yml
  5. +28 −9 DEVELOP.md → CONTRIBUTING.md
  6. +18 −24 Gemfile
  7. +96 −86 README.markdown
  8. +0 −5 Rakefile
  9. +74 −55 manifests/init.pp
  10. +55 −25 manifests/params.pp
  11. +3 −1 manifests/snmpv3_user.pp
  12. +5 −5 metadata.json
  13. +25 −0 spec/classes/snmp_client_spec.rb
  14. +104 −2 spec/classes/snmp_init_spec.rb
  15. +2 −0 templates/snmpd.conf.erb
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ spec/fixtures/
coverage/
*.swp
.vendor/
.vendor
2 changes: 1 addition & 1 deletion .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--fail-on-warnings
--relative
--no-80chars-check
--no-140chars-check
--no-class_inherits_from_params_class-check
--no-documentation-check
--no-single_quote_string_with_variables-check
7 changes: 7 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
.travis.yml:
extras:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
27 changes: 20 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,32 @@ script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake
matrix:
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.0
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="no"
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 2.3.1
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="no"
- rvm: 2.3.1
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
allow_failures:
- rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 4.0"
- rvm: 2.3.1
env: PUPPET_GEM_VERSION="~> 4.0" STRICT_VARIABLES="no"
- rvm: 2.3.1
env: PUPPET_GEM_VERSION="~> 4.0"
notifications:
email:
Expand Down
37 changes: 28 additions & 9 deletions DEVELOP.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,45 @@ Contributing

normal

1. [Fork](http://help.github.com/forking/) puppet-snmp
2. Create a topic branch against the develop branch `git checkout develop; git checkout -b my_branch`
3. Push to your branch `git push origin my_branch`
4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch against the develop branch
1. [Fork](http://help.github.com/forking/) puppet-snmp.
2. Create a topic branch against the develop branch. `git checkout develop; git checkout -b my_branch`
3. Make your change.
4. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test.
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. Push to your branch. `git push origin my_branch`
9. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch against the develop branch.

[git-flow](https://github.com/nvie/gitflow)

1. [Fork](http://help.github.com/forking/) puppet-snmp
2. Create a feature `git flow feature start my-feature`
3. Publish your featue `git flow feature publish my-feature`
4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch against the develop branch
1. [Fork](http://help.github.com/forking/) puppet-snmp.
2. Create a feature. `git flow feature start my-feature`
3. Make your change.
4. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or fixing a bug, please add a test.
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`
9. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch against the develop branch.

Testing
-------

Tests are written with [rspec-puppet](http://rspec-puppet.com/). CI is covered by [Travis CI](http://about.travis-ci.org/) and the current status is visible [here](http://travis-ci.org/razorsedge/puppet-snmp).

To install the test system, pick one of the following:

PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0" bundle install --path=.vendor --without system_tests
PUPPET_GEM_VERSION="~> 3.0" bundle install --path=.vendor --without system_tests
PUPPET_GEM_VERSION="~> 4.0" bundle install --path=.vendor --without system_tests

To run all tests:

rake spec
bundle exec rake validate && \
bundle exec rake lint && \
bundle exec rake metadata_lint && \
bundle exec rake spec SPEC_OPTS='--format documentation' FUTURE_PARSER="yes" STRICT_VARIABLES="no"

Branching
---------
Expand Down
42 changes: 18 additions & 24 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :development, :unit_tests do
gem 'rake', :require => false
gem 'rspec', '~> 2.0', :require => false
gem 'rspec-puppet', '>= 2.1.0', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '>= 1.1.0', :require => false
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false
gem 'metadata-json-lint', '>= 0.0.4', :require => false
gem 'puppet-lint-unquoted_string-check', :require => false
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
gem 'puppet-lint-variable_contains_upcase', :require => false
gem 'rake', '10.5.0', :require => false
gem 'rspec', '~> 2.0', :require => false
gem 'rspec-puppet', '>= 2.1.0', :require => false
gem 'puppetlabs_spec_helper', '~> 1.2', :require => false
gem 'puppet-lint', '~> 2.0', :require => false
gem 'json', '~> 1.8', :require => false if RUBY_VERSION =~ /^1\./
gem 'json', :require => false if RUBY_VERSION =~ /^2\./
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 '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
gem 'puppet-lint-empty_string-check', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
end

if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
gem 'puppet', ENV['PUPPET_GEM_VERSION'], :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false

# vim:ft=ruby
Loading