Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: redbridge/puppetize
base: 4d71cf6836
...
head fork: redbridge/puppetize
compare: ff43905810
Checking mergeability… Don't worry, you can still create the pull request.
  • 14 commits
  • 29 files changed
  • 0 commit comments
  • 2 contributors
Showing with 322 additions and 51 deletions.
  1. BIN  environments/production/modules/fw/files/iptables-persistent_0.5.3ubuntu1_all.deb
  2. +9 −0 environments/production/modules/fw/manifests/file.pp
  3. +7 −15 environments/production/modules/fw/manifests/init.pp
  4. +25 −0 environments/production/modules/fw/manifests/install.pp
  5. +17 −0 environments/production/modules/fw/manifests/params.pp
  6. +11 −0 environments/production/modules/nrpe/Modulefile
  7. +3 −0  environments/production/modules/nrpe/README
  8. +22 −0 environments/production/modules/nrpe/manifests/check.pp
  9. +16 −0 environments/production/modules/nrpe/manifests/config.pp
  10. +27 −0 environments/production/modules/nrpe/manifests/init.pp
  11. +5 −0 environments/production/modules/nrpe/manifests/install.pp
  12. +21 −0 environments/production/modules/nrpe/manifests/params.pp
  13. +7 −0 environments/production/modules/nrpe/manifests/service.pp
  14. +12 −0 environments/production/modules/nrpe/metadata.json
  15. +6 −0 environments/production/modules/nrpe/spec/spec.opts
  16. +18 −0 environments/production/modules/nrpe/spec/spec_helper.rb
  17. +8 −0 environments/production/modules/nrpe/templates/default.cfg.erb
  18. +12 −0 environments/production/modules/nrpe/templates/nrpe.cfg.erb
  19. +1 −0  environments/production/modules/nrpe/templates/service_template.cfg.erb
  20. +1 −0  environments/production/modules/nrpe/tests/init.pp
  21. +10 −7 environments/production/modules/puppet/manifests/client.pp
  22. +0 −2  environments/production/modules/puppet/manifests/client/config.pp
  23. +6 −1 environments/production/modules/puppet/manifests/init.pp
  24. +5 −21 environments/production/modules/puppet/manifests/install.pp
  25. +18 −0 environments/production/modules/puppet/manifests/install/client.pp
  26. +19 −0 environments/production/modules/puppet/manifests/install/master.pp
  27. +5 −4 environments/production/modules/puppet/manifests/master.pp
  28. +30 −0 environments/production/modules/puppet/manifests/params.pp
  29. +1 −1  environments/production/modules/ssh/manifests/params.pp
View
BIN  environments/production/modules/fw/files/iptables-persistent_0.5.3ubuntu1_all.deb
Binary file not shown
View
9 environments/production/modules/fw/manifests/file.pp
@@ -0,0 +1,9 @@
+# Puts an iptables-persistent package on systems
+class fw::file {
+ if $lsbdistcodename == 'precise' {
+ file{'/tmp/iptables-persistent_0.5.3ubuntu1_all.deb':
+ ensure => present,
+ source => 'puppet:///modules/fw/iptables-persistent_0.5.3ubuntu1_all.deb',
+ }
+ }
+}
View
22 environments/production/modules/fw/manifests/init.pp
@@ -1,17 +1,9 @@
# Class: fw
-#
-# This module manages fw
-#
-# Parameters:
-#
-# Actions:
-#
-# Requires:
-#
-# Sample Usage:
-#
-# [Remember: No empty lines between comments and class definition]
-class fw {
-
-
+class fw (
+ $packages = $fw::params::packages,
+) inherits fw::params {
+ anchor { 'fw::start': } ->
+ class { 'fw::file': } ->
+ class { 'fw::install': } ~>
+ anchor { 'fw::end': }
}
View
25 environments/production/modules/fw/manifests/install.pp
@@ -0,0 +1,25 @@
+class fw::install {
+ case $::operatingsystem {
+ ubuntu, debian: {
+ if $lsbdistcodename == 'precise' {
+ package {$fw::packages:
+ ensure => present,
+ provider => 'dpkg',
+ source => '/tmp/iptables-persistent_0.5.3ubuntu1_all.deb'
+ }
+ } else {
+ package {$fw::packages:
+ ensure => present,
+ }
+ }
+ }
+ redhat, centos : {
+ package {$fw::packages:
+ ensure => present
+ }
+ }
+ default: {
+ fail('Unknown OS')
+ }
+ }
+}
View
17 environments/production/modules/fw/manifests/params.pp
@@ -0,0 +1,17 @@
+#
+#
+#
+#
+class fw::params {
+ case $::operatingsystem {
+ ubuntu, debian: {
+ $packages = ['iptables-persistent']
+ }
+ redhat, centos: {
+ $packages = ['iptables']
+ }
+ default: {
+ fail("Unkown OS: $::operatingsystem")
+ }
+ }
+}
View
11 environments/production/modules/nrpe/Modulefile
@@ -0,0 +1,11 @@
+name 'site-nrpe'
+version '0.0.1'
+source 'UNKNOWN'
+author 'site'
+license 'UNKNOWN'
+summary 'UNKNOWN'
+description 'UNKNOWN'
+project_page 'UNKNOWN'
+
+## Add dependencies, if any:
+# dependency 'username/name', '>= 1.2.0'
View
3  environments/production/modules/nrpe/README
@@ -0,0 +1,3 @@
+nrpe
+
+This is the nrpe module.
View
22 environments/production/modules/nrpe/manifests/check.pp
@@ -0,0 +1,22 @@
+## Define: nrpe::check
+#
+# Adds services to be checked in nrpe
+#
+# Parameters:
+#
+# Actions:
+#
+# Requires:
+#
+# Sample Usage:
+# nrpe::check { 'proc_syslog': check_name => 'proc_syslog', check_binary => 'check_procs', check_args => '-w 1: -c 1:2 -C rsyslogd'}
+# nrpe::check { 'home_disk': check_name => 'home_disk', check_binary => 'check_disk', check_args => '-w 20% -c 10% -p /home -m'}
+#
+define nrpe::check ($check_name, $check_binary, $check_args) {
+ $plugin_dir = $nrpe::params::plugin_dir
+ $config_dir_d = $nrpe::params::config_dir_d
+ file{"$nrpe::config_dir_d/$check_name.cfg":
+ content => template('nrpe/service_template.cfg.erb'),
+ notify => Class['nrpe::service']
+ }
+}
View
16 environments/production/modules/nrpe/manifests/config.pp
@@ -0,0 +1,16 @@
+class nrpe::config {
+ $nagios_server = $nrpe::nagios_server
+ $plugin_dir = $nrpe::plugin_dir
+ file {"$nrpe::config_file":
+ ensure => present,
+ content => template('nrpe/nrpe.cfg.erb'),
+ require => Class['nrpe::install'],
+ notify => Class['nrpe::service']
+ }
+ file {"$nrpe::config_dir_d/varmdo.cfg":
+ ensure => present,
+ content => template('nrpe/default.cfg.erb'),
+ require => Class['nrpe::install'],
+ notify => Class['nrpe::service']
+ }
+}
View
27 environments/production/modules/nrpe/manifests/init.pp
@@ -0,0 +1,27 @@
+# Class: nrpe
+#
+# This module manages nrpe
+#
+# Parameters:
+#
+# Actions:
+#
+# Requires:
+#
+# Sample Usage:
+#
+# [Remember: No empty lines between comments and class definition]
+class nrpe (
+ $nagios_server,
+ $packages = $nrpe::params::packages,
+ $service = $nrpe::params::service,
+ $config_file = $nrpe::params::config_file,
+ $config_dir_d = $nrpe::params::config_dir_d,
+ $plugin_dir = $nrpe::params::plugin_dir,
+) inherits nrpe::params {
+ anchor { 'nrpe::start': } ->
+ class { 'nrpe::install': } ->
+ class { 'nrpe::config': } ->
+ class { 'nrpe::service': } ->
+ anchor { 'nrpe::end': }
+}
View
5 environments/production/modules/nrpe/manifests/install.pp
@@ -0,0 +1,5 @@
+class nrpe::install {
+ package { "$nrpe::packages":
+ ensure => present
+ }
+}
View
21 environments/production/modules/nrpe/manifests/params.pp
@@ -0,0 +1,21 @@
+class nrpe::params {
+ file{"/etc/nagios":
+ ensure => directory
+ }
+ file{"/etc/nagios/nrpe.d":
+ ensure => directory
+ }
+ case $::operatingsystem {
+ ubuntu, debian: {
+ $packages = 'nagios-nrpe-server'
+ $service = 'nagios-nrpe-server'
+ $config_file = '/etc/nagios/nrpe.cfg'
+ $config_dir_d = '/etc/nagios/nrpe.d'
+ $plugin_dir = '/usr/lib/nagios/plugins'
+ }
+ redhat, centos: {
+ $packages = 'nagios-nrpe'
+ }
+ default: { fail('Unkown OS') }
+ }
+}
View
7 environments/production/modules/nrpe/manifests/service.pp
@@ -0,0 +1,7 @@
+class nrpe::service {
+ service{"$nrpe::service":
+ enable => true,
+ ensure => running,
+ hasstatus => true,
+ }
+}
View
12 environments/production/modules/nrpe/metadata.json
@@ -0,0 +1,12 @@
+/*
++-----------------------------------------------------------------------+
+| |
+| ==> DO NOT EDIT THIS FILE! <== |
+| |
+| You should edit the `Modulefile` and run `puppet-module build` |
+| to generate the `metadata.json` file for your releases. |
+| |
++-----------------------------------------------------------------------+
+*/
+
+{}
View
6 environments/production/modules/nrpe/spec/spec.opts
@@ -0,0 +1,6 @@
+--format
+s
+--colour
+--loadby
+mtime
+--backtrace
View
18 environments/production/modules/nrpe/spec/spec_helper.rb
@@ -0,0 +1,18 @@
+require 'pathname'
+dir = Pathname.new(__FILE__).parent
+$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib')
+
+require 'mocha'
+require 'puppet'
+gem 'rspec', '=1.2.9'
+require 'spec/autorun'
+
+Spec::Runner.configure do |config|
+ config.mock_with :mocha
+end
+
+# We need this because the RAL uses 'should' as a method. This
+# allows us the same behaviour but with a different method name.
+class Object
+ alias :must :should
+end
View
8 environments/production/modules/nrpe/templates/default.cfg.erb
@@ -0,0 +1,8 @@
+command[users]=<%= plugin_dir %>/check_users -w 5 -c 10
+command[load]=<%= plugin_dir %>/check_load -w 15,10,5 -c 30,25,20
+command[zombie_procs]=<%= plugin_dir %>/check_procs -w 5 -c 10 -s Z
+command[total_procs]=<%= plugin_dir %>/check_procs -w 150 -c 200
+command[swap]=<%= plugin_dir %>/check_swap -w 20% -c 10%
+command[root_disk]=<%= plugin_dir %>/check_disk -w 20% -c 10% -p / -m
+command[var_disk]=<%= plugin_dir %>/check_disk -w 20% -c 10% -p /var -m
+
View
12 environments/production/modules/nrpe/templates/nrpe.cfg.erb
@@ -0,0 +1,12 @@
+log_facility=daemon
+pid_file=/var/run/nagios/nrpe.pid
+server_port=5666
+nrpe_user=nagios
+nrpe_group=nagios
+allowed_hosts=<%= nagios_server %>
+dont_blame_nrpe=0
+debug=0
+command_timeout=60
+connection_timeout=300
+include=/etc/nagios/nrpe_local.cfg
+include_dir=/etc/nagios/nrpe.d/
View
1  environments/production/modules/nrpe/templates/service_template.cfg.erb
@@ -0,0 +1 @@
+command[<%= check_name %>]=<%= plugin_dir %>/<%= check_binary %> <%= check_args %>
View
1  environments/production/modules/nrpe/tests/init.pp
@@ -0,0 +1 @@
+include nrpe
View
17 environments/production/modules/puppet/manifests/client.pp
@@ -1,13 +1,16 @@
+#! /usr/bin/env puppet
+# Author: Magnus Bengtsson <magnus.bengtsson@redbridge.se>
#
#
#
#
define puppet::client ($puppetserver, $puppetversion){
- class { puppet::install::client:
- puppetversion => $puppetversion,
- }
- include puppet::client::service
- class { puppet::client::config:
- puppetserver => $puppetserver,
- }
+ include puppet
+ class { puppet::install::client:
+ puppetversion => $puppetversion,
+ }
+ include puppet::client::service
+ class { puppet::client::config:
+ puppetserver => $puppetserver,
+ }
}
View
2  environments/production/modules/puppet/manifests/client/config.pp
@@ -12,5 +12,3 @@
notify => Class["puppet::client::service"],
}
}
-
-
View
7 environments/production/modules/puppet/manifests/init.pp
@@ -11,5 +11,10 @@
# Sample Usage:
#
# [Remember: No empty lines between comments and class definition]
-class puppet {
+class puppet (
+ $augpkgs = $puppet::params::augpkgs,
+ $puppetpkgs = $puppet::params::puppetpkgs,
+ $puppetmasterpkgs = $puppet::params::puppetmasterpkgs
+) inherits puppet::params {
+ info("Running puppet module packages: $augpkgs $puppetpkgs $puppetmasterpkgs")
}
View
26 environments/production/modules/puppet/manifests/install.pp
@@ -3,25 +3,9 @@
#
#
class puppet::install {
- include puppet::repo
- $augpkgs = $operatingsystem ? {
- /(RedHat|Fedora|CentOS)/ => ["augeas", "ruby-augeas"],
- /(Ubuntu|Debian)/ => ["augeas-tools", "libaugeas-ruby", "libaugeas0"],
- }
- package { $augpkgs:
- ensure => present,
- }
-}
-
-class puppet::install::master($puppetversion) inherits puppet::install {
- package { "puppet-server":
- ensure => $puppetversion,
- }
-}
-
-class puppet::install::client($puppetversion) inherits puppet::install {
- package { "puppet":
- ensure => $puppetversion,
- require => Class["puppet::repo"]
- }
+ include puppet::repo
+ package { $puppet::augpkgs:
+ ensure => present,
+ require => Class['puppet::repo']
+ }
}
View
18 environments/production/modules/puppet/manifests/install/client.pp
@@ -0,0 +1,18 @@
+#! /usr/bin/env puppet
+# Author: Magnus Bengtsson <magnus.bengtsson@redbridge.se>
+# Class: puppet::install::client
+#
+#
+#
+# Parameters:
+#
+# Actions:
+#
+# Requires:
+#
+# Sample Usage:
+class puppet::install::client($puppetversion) inherits puppet::install {
+ package { $puppet::puppetpkgs:
+ ensure => $puppetversion,
+ }
+}
View
19 environments/production/modules/puppet/manifests/install/master.pp
@@ -0,0 +1,19 @@
+#! /usr/bin/env puppet
+# Author: Magnus Bengtsson <magnus.bengtsson@redbridge.se>
+# Class: puppet::install::master
+#
+#
+#
+# Parameters:
+#
+# Actions:
+#
+# Requires:
+#
+# Sample Usage:
+#
+class puppet::install::master($puppetversion) inherits puppet::install {
+ package{ $puppet::puppetmasterpkgs:
+ ensure => $puppetversion
+ }
+}
View
9 environments/production/modules/puppet/manifests/master.pp
@@ -3,8 +3,9 @@
#
#
define puppet::master($puppetversion){
- class { puppet::install::master:
- puppetversion => $puppetversion,
- }
- include puppet::master::service
+ include puppet
+ class { puppet::install::master:
+ puppetversion => $puppetversion,
+ }
+ include puppet::master::service
}
View
30 environments/production/modules/puppet/manifests/params.pp
@@ -0,0 +1,30 @@
+# Class: puppet::params
+#
+# Sets params used in the puppet module
+#
+# Parameters:
+#
+# Actions:
+#
+# Requires:
+#
+# Sample Usage:
+#
+class puppet::params {
+ $module = "puppet"
+ case $::operatingsystem {
+ centos, redhat: {
+ $augpkgs = ['augeas', 'ruby-augeas']
+ $puppetpkgs = ['puppet']
+ $puppetmasterpkgs = ['puppet-server']
+ }
+ ubuntu, debian: {
+ $augpkgs = ["augeas-tools", "libaugeas-ruby", "libaugeas0"]
+ $puppetpkgs = ['puppet-common', 'puppet']
+ $puppetmasterpkgss = ['puppetmaster']
+ }
+ default: {
+ fail('Unknown OS')
+ }
+ }
+}
View
2  environments/production/modules/ssh/manifests/params.pp
@@ -5,7 +5,7 @@
class ssh::params {
case $::operatingsystem {
ubuntu, debian: {
- $packages = 'openssh'
+ $packages = ['openssh-server', 'openssh-client']
}
redhat, centos: {
$packages = ['openssh', 'openssh-server', 'openssh-clients']

No commit comments for this range

Something went wrong with that request. Please try again.