22 changes: 21 additions & 1 deletion .project
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>snmpd</name>
<name>snmp</name>
<comment></comment>
<projects>
</projects>
Expand All @@ -20,4 +20,24 @@
<nature>org.cloudsmith.geppetto.pp.dsl.ui.puppetNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
<filteredResources>
<filter>
<id>1335048051348</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-pkg</arguments>
</matcher>
</filter>
<filter>
<id>1335048051363</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-false-false-spec/fixtures/modules</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: ruby
rvm: 1.8.7
script: "rake spec"
branches:
only:
- master
notifications:
email:
- github@razorsedge.org
env:
- PUPPET_VERSION=2.6.4
- PUPPET_VERSION=2.6.9
- PUPPET_VERSION=2.6.16
- PUPPET_VERSION=2.7.6
- PUPPET_VERSION=2.7.9
- PUPPET_VERSION=2.7.12
- PUPPET_VERSION=2.7.13
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source :rubygems

if ENV.key?('PUPPET_VERSION')
puppetversion = "= #{ENV['PUPPET_VERSION']}"
else
puppetversion = ['>= 2.7']
end

gem 'rake'
gem 'puppet-lint'
gem 'rspec-puppet'
gem 'puppet', puppetversion
28 changes: 23 additions & 5 deletions Modulefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
name 'razorsedge-snmpd'
version '0.0.1'
name 'razorsedge-snmp'
version '1.0.0'

author 'razorsedge'
license 'Apache 2.0'
project_page 'https://github.com/runningman/puppet-snmpd'
source 'git://github.com/runningman/puppet-snmpd.git'
project_page 'https://github.com/runningman/puppet-snmp'
source 'git://github.com/runningman/puppet-snmp.git'
summary 'Puppet module to manage SNMP.'
description 'UNKNOWN'
description 'This module manages the installation of the SNMP server, SNMP client, and SNMP
trap server. It also can create a SNMPv3 user with authentication and privacy
passwords.
Actions:
Installs the SNMP client package and configuration.
Installs the SNMP daemon package, service, and configuration.
Installs the SNMP trap daemon service and configuration.
Creates a SNMPv3 user with authentication and encryption paswords.
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 - presently unsupported (patches welcome)
Solaris family - presently unsupported (patches welcome)
Class documentation is available via puppetdoc.'
55 changes: 53 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,62 @@
Puppet SNMP Module
==================

[![Build Status](https://secure.travis-ci.org/runningman/puppet-snmp.png?branch=master)](http://travis-ci.org/runningman/puppet-snmp)

Introduction
------------

This is the snmpd module.
It does not work yet.
This module manages the installation of the SNMP server, SNMP client, and SNMP
trap server. It also can create a SNMPv3 user with authentication and privacy
passwords.

Actions:

* Installs the SNMP client package and configuration.
* Installs the SNMP daemon package, service, and configuration.
* Installs the SNMP trap daemon service and configuration.
* Creates a SNMPv3 user with authentication and encryption paswords.

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 - presently unsupported (patches welcome)
* Solaris family - presently unsupported (patches welcome)

Class documentation is available via puppetdoc.

Examples
--------

class { 'snmp': }

class { 'snmp::server':
ro_community => 'notpublic',
ro_network => '10.20.30.40/32',
contact => 'root@yourdomain.org',
location => 'Phoenix, AZ',
}

class { 'snmp::trapd':
ro_community => 'public',
}

snmp::snmpv3_user { 'myuser':
authpass => '1234auth',
privpass => '5678priv',
}

Notes
-----

* Only tested on CentOS 5.8 and CentOS 6.2 x86_64.

Issues
------

* None.

Copyright
---------
Expand Down
60 changes: 60 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
require 'rake'
require 'rspec/core/rake_task'

#task :default => [:spec, :lint]
task :default do
system("rake -T")
end

desc "Run all rspec-puppet tests"
RSpec::Core::RakeTask.new(:spec) do |t|
t.pattern = 'spec/*/*_spec.rb'
end

desc "Run all rspec-puppet tests visually"
RSpec::Core::RakeTask.new(:vspec) do |t|
t.rspec_opts = ['--color', '--format documentation']
t.pattern = 'spec/*/*_spec.rb'
end

def update_module_version
gitdesc = %x{git describe}.chomp
semver = gitdesc.gsub(/v?(\d+\.\d+\.\d+)-?(.*)/) do
newver = "#{$1}"
newver << "git-#{$2}" unless $2.empty?
newver
end
modulefile = File.read("Modulefile")
modulefile.gsub!(/^\s*version\s+'.*?'/, "version '#{semver}'")
File.open("Modulefile", 'w') do |f|
f.write(modulefile)
end
semver
end

desc "Build Puppet Module Package"
task :build do
# system("gimli README*.markdown")
FileUtils.cp "Modulefile", ".Modulefile.bak"
update_module_version
system("puppet-module build")
FileUtils.mv ".Modulefile.bak", "Modulefile"
end
#desc "Build puppet module package"
#task :build do
# # This will be deprecated once puppet-module is a face.
# begin
# Gem::Specification.find_by_name('puppet-module')
# rescue Gem::LoadError, NoMethodError
# require 'puppet/face'
# pmod = Puppet::Face['module', :current]
# pmod.build('./')
# end
#end

desc "Check puppet manifests with puppet-lint"
task :lint do
# This requires pull request: https://github.com/rodjek/puppet-lint/pull/81
system("echo '** manifests'; puppet-lint --with-filename manifests")
system("echo '** tests'; puppet-lint --with-filename tests")
end
3 changes: 0 additions & 3 deletions files/snmpd.sysconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
###
### File managed by Puppet
###
# snmpd command line options
# OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"
OPTIONS="-LS4d -Lf /dev/null -p /var/run/snmpd.pid -a"
6 changes: 6 additions & 0 deletions files/snmpd.sysconfig-RedHat-5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
###
### File managed by Puppet
###
# snmpd command line options
# OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"
OPTIONS="-LS4d -Lf /dev/null -p /var/run/snmpd.pid -a"
5 changes: 5 additions & 0 deletions files/snmpd.sysconfig-RedHat-6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
###
### File managed by Puppet
###
# snmpd command line options
# OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid"
8 changes: 6 additions & 2 deletions files/snmptrapd.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
###
### File managed by Puppet
###

#authCommunity log,execute,net public
# Example configuration file for snmptrapd
#
# No traps are handled by default, you must edit this file!
#
# authCommunity log,execute,net public
# traphandle SNMPv2-MIB::coldStart /usr/bin/bin/my_great_script cold
2 changes: 0 additions & 2 deletions files/snmptrapd.sysconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
###
### File managed by Puppet
###
# snmptrapd command line options
# OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
5 changes: 5 additions & 0 deletions files/snmptrapd.sysconfig-RedHat-5
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
###
### File managed by Puppet
###
# snmptrapd command line options
# OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
5 changes: 5 additions & 0 deletions files/snmptrapd.sysconfig-RedHat-6
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
###
### File managed by Puppet
###
# snmptrapd command line options
# OPTIONS="-Lsd -p /var/run/snmptrapd.pid"
34 changes: 0 additions & 34 deletions manifests/client.pp

This file was deleted.

18 changes: 0 additions & 18 deletions manifests/disable.pp

This file was deleted.

Loading