summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorEwoud Kohl van Wijngaarden <e.kohlvanwijngaarden@oxilion.nl>2013-05-06 18:13:12 +0200
committerEwoud Kohl van Wijngaarden <e.kohlvanwijngaarden@oxilion.nl>2013-07-02 19:20:22 +0200
commitaaf55c9ebfa0e34f63b2ca3c2b660e1d164026dd (patch)
treea57cb9f94b00a43efbcd15b6e8b507d6de22be3b /manifests
parent46c1aeb48f03f5eb0f761f0135de967a62986515 (diff)
lintify
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client.pp4
-rw-r--r--manifests/client/base.pp26
-rw-r--r--manifests/client/centos.pp1
-rw-r--r--manifests/client/darwin.pp29
-rw-r--r--manifests/client/debian.pp9
-rw-r--r--manifests/client/gentoo.pp3
-rw-r--r--manifests/client/openbsd.pp2
-rw-r--r--manifests/client/package.pp1
-rw-r--r--manifests/host.pp18
-rw-r--r--manifests/host/cgi.pp9
-rw-r--r--manifests/plugin.pp2
-rw-r--r--manifests/plugin/deploy.pp2
-rw-r--r--manifests/plugin/scriptpaths.pp13
-rw-r--r--manifests/plugins/base.pp16
-rw-r--r--manifests/plugins/centos.pp5
-rw-r--r--manifests/plugins/debian.pp1
-rw-r--r--manifests/plugins/djbdns.pp5
-rw-r--r--manifests/plugins/dom0.pp1
-rw-r--r--manifests/plugins/gentoo.pp3
-rw-r--r--manifests/plugins/interfaces.pp30
-rw-r--r--manifests/plugins/kvm.pp1
-rw-r--r--manifests/plugins/linux.pp7
-rw-r--r--manifests/plugins/muninhost.pp3
-rw-r--r--manifests/plugins/openbsd.pp5
-rw-r--r--manifests/plugins/physical.pp6
-rw-r--r--manifests/plugins/selinux.pp1
-rw-r--r--manifests/plugins/setup.pp5
-rw-r--r--manifests/plugins/vserver.pp4
-rw-r--r--manifests/register.pp3
-rw-r--r--manifests/register/snmp.pp9
-rw-r--r--manifests/remoteplugin.pp15
-rw-r--r--manifests/snmp_collector.pp23
32 files changed, 152 insertions, 110 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 2316bc9..4d70cac 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -22,8 +22,8 @@ class munin::client(
}
if $munin::client::manage_shorewall {
class{'shorewall::rules::munin':
- munin_port => $port,
- munin_collector => delete($allow,'127.0.0.1'),
+ munin_port => $port,
+ munin_collector => delete($allow,'127.0.0.1'),
collector_source => $shorewall_collector_source,
}
}
diff --git a/manifests/client/base.pp b/manifests/client/base.pp
index 78398a9..3c0ba89 100644
--- a/manifests/client/base.pp
+++ b/manifests/client/base.pp
@@ -1,24 +1,30 @@
+# Install a basic munin client
class munin::client::base {
service { 'munin-node':
- ensure => running,
- enable => true,
- hasstatus => true,
+ ensure => running,
+ enable => true,
+ hasstatus => true,
hasrestart => true,
}
file {'/etc/munin':
ensure => directory,
- mode => 0755, owner => root, group => 0;
+ mode => '0755',
+ owner => root,
+ group => 0,
}
file {'/etc/munin/munin-node.conf':
content => template("munin/munin-node.conf.${::operatingsystem}"),
- notify => Service['munin-node'],
- mode => 0644, owner => root, group => 0,
+ notify => Service['munin-node'],
+ mode => '0644',
+ owner => root,
+ group => 0,
+ }
+ $host = $munin::client::host ? {
+ '*' => $::fqdn,
+ default => $munin::client::host
}
munin::register { $::fqdn:
- host => $munin::client::host ? {
- '*' => $::fqdn,
- default => $munin::client::host
- },
+ host => $host,
port => $munin::client::port,
use_ssh => $munin::client::use_ssh,
config => [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10'],
diff --git a/manifests/client/centos.pp b/manifests/client/centos.pp
index 3a7151b..cd4f2f6 100644
--- a/manifests/client/centos.pp
+++ b/manifests/client/centos.pp
@@ -1,3 +1,4 @@
+# Install a munin client on centos
class munin::client::centos inherits munin::client::package {
include munin::plugins::centos
}
diff --git a/manifests/client/darwin.pp b/manifests/client/darwin.pp
index 264263d..7639896 100644
--- a/manifests/client/darwin.pp
+++ b/manifests/client/darwin.pp
@@ -1,21 +1,22 @@
+# Install a munin client on darwin
class munin::client::darwin {
- file { "/usr/share/snmp/snmpd.conf":
- mode => 744,
- content => template("munin/darwin_snmpd.conf.erb"),
- group => 0,
- owner => root,
+ file { '/usr/share/snmp/snmpd.conf':
+ mode => '0744',
+ content => template('munin/darwin_snmpd.conf.erb'),
+ group => 0,
+ owner => root,
}
- line{"startsnmpdno":
- file => "/etc/hostconfig",
- line => "SNMPSERVER=-NO-",
- ensure => 'absent',
+ line{'startsnmpdno':
+ ensure => absent,
+ file => '/etc/hostconfig',
+ line => 'SNMPSERVER=-NO-',
}
- line { "startsnmpdyes":
- file => "/etc/hostconfig",
- line => "SNMPSERVER=-YES-",
- notify => Exec["/sbin/SystemStarter start SNMP"],
+ line { 'startsnmpdyes':
+ file => '/etc/hostconfig',
+ line => 'SNMPSERVER=-YES-',
+ notify => Exec['/sbin/SystemStarter start SNMP'],
}
- exec{"/sbin/SystemStarter start SNMP":
+ exec{'/sbin/SystemStarter start SNMP':
noop => false,
}
munin::register::snmp { $::fqdn: }
diff --git a/manifests/client/debian.pp b/manifests/client/debian.pp
index e67ac26..3cfc3fc 100644
--- a/manifests/client/debian.pp
+++ b/manifests/client/debian.pp
@@ -1,15 +1,16 @@
+# Install the munin client on debian
class munin::client::debian inherits munin::client::package {
# the plugin will need that
- package { "iproute": ensure => installed }
+ package { 'iproute': ensure => installed }
- Service["munin-node"]{
+ Service['munin-node']{
# sarge's munin-node init script has no status
hasstatus => $::lsbdistcodename ? { sarge => false, default => true }
}
- File["/etc/munin/munin-node.conf"]{
+ File['/etc/munin/munin-node.conf']{
content => template("munin/munin-node.conf.${::operatingsystem}.${::lsbdistcodename}"),
}
# workaround bug in munin_node_configure
- plugin { "postfix_mailvolume": ensure => absent }
+ plugin { 'postfix_mailvolume': ensure => absent }
include munin::plugins::debian
}
diff --git a/manifests/client/gentoo.pp b/manifests/client/gentoo.pp
index e79f6b0..186950b 100644
--- a/manifests/client/gentoo.pp
+++ b/manifests/client/gentoo.pp
@@ -1,7 +1,8 @@
+# install a munin client on gentoo
class munin::client::gentoo inherits munin::client::package {
Package['munin-node'] {
- name => 'munin',
+ name => 'munin',
category => 'net-analyzer',
}
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index cd21abf..e3c18d5 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -4,7 +4,7 @@
class munin::client::openbsd inherits munin::client::base {
if $::operatingsystemrelease == '4.3' {
file{'/usr/src/munin_openbsd.tar.gz':
- source => "puppet:///modules/munin/openbsd/package/munin_openbsd.tar.gz",
+ source => 'puppet:///modules/munin/openbsd/package/munin_openbsd.tar.gz',
owner => root,
group => 0,
mode => '0600';
diff --git a/manifests/client/package.pp b/manifests/client/package.pp
index 206ccc8..0958202 100644
--- a/manifests/client/package.pp
+++ b/manifests/client/package.pp
@@ -1,3 +1,4 @@
+# Install a munin client using packages
class munin::client::package inherits munin::client::base {
package { 'munin-node': ensure => installed }
Service['munin-node']{
diff --git a/manifests/host.pp b/manifests/host.pp
index 007c43a..e666c3d 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -7,7 +7,7 @@ class munin::host(
$cgi_owner = 'os_default',
$export_tag = 'munin'
) {
- package {"munin": ensure => installed, }
+ package {'munin': ensure => installed, }
include concat::setup
Concat::Fragment <<| tag == $export_tag |>>
@@ -17,15 +17,17 @@ class munin::host(
source => [ "puppet:///modules/site_munin/config/host/${::fqdn}/munin.conf.header",
"puppet:///modules/site_munin/config/host/munin.conf.header.${::operatingsystem}.${::lsbdistcodename}",
"puppet:///modules/site_munin/config/host/munin.conf.header.${::operatingsystem}",
- "puppet:///modules/site_munin/config/host/munin.conf.header",
+ 'puppet:///modules/site_munin/config/host/munin.conf.header',
"puppet:///modules/munin/config/host/munin.conf.header.${::operatingsystem}.${::lsbdistcodename}",
"puppet:///modules/munin/config/host/munin.conf.header.${::operatingsystem}",
- "puppet:///modules/munin/config/host/munin.conf.header" ],
- order => 05,
+ 'puppet:///modules/munin/config/host/munin.conf.header' ],
+ order => 05,
}
- concat{ "/etc/munin/munin.conf":
- owner => root, group => 0, mode => 0644;
+ concat{ '/etc/munin/munin.conf':
+ owner => root,
+ group => 0,
+ mode => '0644',
}
include munin::plugins::muninhost
@@ -39,7 +41,9 @@ class munin::host(
# from time to time we cleanup hanging munin-runs
file{'/etc/cron.d/munin_kill':
content => "4,34 * * * * root if $(ps ax | grep -v grep | grep -q munin-run); then killall munin-run; fi\n",
- owner => root, group => 0, mode => 0644;
+ owner => root,
+ group => 0,
+ mode => '0644',
}
if $munin::host::manage_shorewall {
include shorewall::rules::out::munin
diff --git a/manifests/host/cgi.pp b/manifests/host/cgi.pp
index 1c0072d..5b0ecbb 100644
--- a/manifests/host/cgi.pp
+++ b/manifests/host/cgi.pp
@@ -1,3 +1,4 @@
+# Set up a munin host using CGI rendering
class munin::host::cgi(
$owner = 'os_default'
) {
@@ -31,9 +32,11 @@ class munin::host::cgi(
file{'/etc/logrotate.d/munin':
source => [ "puppet:///modules/site_munin/config/host/${::fqdn}/logrotate",
"puppet:///modules/site_munin/config/host/logrotate.${::operatingsystem}",
- "puppet:///modules/site_munin/config/host/logrotate",
+ 'puppet:///modules/site_munin/config/host/logrotate',
"puppet:///modules/munin/config/host/logrotate.${::operatingsystem}",
- "puppet:///modules/munin/config/host/logrotate" ],
- owner => root, group => 0, mode => 0644;
+ 'puppet:///modules/munin/config/host/logrotate' ],
+ owner => root,
+ group => 0,
+ mode => '0644',
}
}
diff --git a/manifests/plugin.pp b/manifests/plugin.pp
index ffe5452..60af877 100644
--- a/manifests/plugin.pp
+++ b/manifests/plugin.pp
@@ -26,7 +26,7 @@ define munin::plugin (
require => $dep,
notify => Service['munin-node'];
}
- if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
+ if (str2bool($::selinux) == true) and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
File[$plugin]{
seltype => 'munin_etc_t',
}
diff --git a/manifests/plugin/deploy.pp b/manifests/plugin/deploy.pp
index cbf64fb..c514eed 100644
--- a/manifests/plugin/deploy.pp
+++ b/manifests/plugin/deploy.pp
@@ -23,7 +23,7 @@ define munin::plugin::deploy(
mode => '0755';
}
- if ($::selinux == 'true') and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
+ if (str2bool($::selinux) == true) and (($::operatingsystem != 'CentOS') or ($::operatingsystem == 'CentOS' and $::lsbmajdistrelease != '5')){
File["munin_plugin_${name}"]{
seltype => $seltype,
}
diff --git a/manifests/plugin/scriptpaths.pp b/manifests/plugin/scriptpaths.pp
index 2cad97b..f31f38d 100644
--- a/manifests/plugin/scriptpaths.pp
+++ b/manifests/plugin/scriptpaths.pp
@@ -1,12 +1,13 @@
+# Determine the script path for each OS
class munin::plugin::scriptpaths {
case $::operatingsystem {
- gentoo: { $script_path = "/usr/libexec/munin/plugins" }
- debian: { $script_path = "/usr/share/munin/plugins" }
- centos: { $script_path = "/usr/share/munin/plugins" }
+ gentoo: { $script_path = '/usr/libexec/munin/plugins' }
+ debian: { $script_path = '/usr/share/munin/plugins' }
+ centos: { $script_path = '/usr/share/munin/plugins' }
openbsd: { $script_path = $::operatingsystemrelease ? {
- '4.3' => '/opt/munin/lib/plugins/',
- default => '/usr/local/libexec/munin/plugins/'
+ '4.3' => '/opt/munin/lib/plugins/',
+ default => '/usr/local/libexec/munin/plugins/',
} }
- default: { $script_path = "/usr/share/munin/plugins" }
+ default: { $script_path = '/usr/share/munin/plugins' }
}
}
diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp
index c6b88ed..33cd84d 100644
--- a/manifests/plugins/base.pp
+++ b/manifests/plugins/base.pp
@@ -1,29 +1,33 @@
+# A basic set of plugins
class munin::plugins::base {
# setup basic plugins
munin::plugin {
- [ df, cpu, interrupts, load, memory, netstat, open_files,
- processes, swap, uptime, users, vmstat ]:
+ [ 'df', 'cpu', 'interrupts', 'load', 'memory', 'netstat', 'open_files',
+ 'processes', 'swap', 'uptime', 'users', 'vmstat' ]:
ensure => present,
}
file{'/etc/munin/plugin-conf.d/df':
content => "[df*]\nenv.exclude none unknown iso9660 squashfs udf romfs ramfs debugfs binfmt_misc rpc_pipefs fuse.gvfs-fuse-daemon\n",
- require => Munin::Plugin[df],
- owner => root, group => 0, mode => 0644;
+ require => Munin::Plugin['df'],
+ owner => 'root',
+ group => 0,
+ mode => '0644',
}
include munin::plugins::interfaces
case $::kernel {
openbsd: { include munin::plugins::openbsd }
linux: {
- case $vserver {
+ case $::vserver {
guest: { include munin::plugins::vserver }
default: { include munin::plugins::linux }
}
}
}
-
+
case $::virtual {
physical: { include munin::plugins::physical }
xen0: { include munin::plugins::dom0 }
+ default: { }
}
}
diff --git a/manifests/plugins/centos.pp b/manifests/plugins/centos.pp
index 60c706c..0bb7697 100644
--- a/manifests/plugins/centos.pp
+++ b/manifests/plugins/centos.pp
@@ -1,3 +1,6 @@
+# Install munin plugins for centos
class munin::plugins::centos inherits munin::plugins::base {
- munin::plugin { users: ensure => present; }
+ munin::plugin { 'users':
+ ensure => present,
+ }
}
diff --git a/manifests/plugins/debian.pp b/manifests/plugins/debian.pp
index f756150..efa922b 100644
--- a/manifests/plugins/debian.pp
+++ b/manifests/plugins/debian.pp
@@ -1 +1,2 @@
+# Debian specific plugins
class munin::plugins::debian { }
diff --git a/manifests/plugins/djbdns.pp b/manifests/plugins/djbdns.pp
index c0a5163..de3936b 100644
--- a/manifests/plugins/djbdns.pp
+++ b/manifests/plugins/djbdns.pp
@@ -1,3 +1,4 @@
-class munin::plugins::djbdns {
- munin::plugin::deploy { "tinydns": }
+# Set up the djbdns plugin
+class munin::plugins::djbdns {
+ munin::plugin::deploy { 'tinydns': }
}
diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp
index 44995fc..98aee1d 100644
--- a/manifests/plugins/dom0.pp
+++ b/manifests/plugins/dom0.pp
@@ -1,3 +1,4 @@
+# Set up plugins for a Xen dom0 host
class munin::plugins::dom0 {
munin::plugin::deploy {
[ 'xen', 'xen_cpu', 'xen_memory', 'xen_mem',
diff --git a/manifests/plugins/gentoo.pp b/manifests/plugins/gentoo.pp
index 27d4689..36f2370 100644
--- a/manifests/plugins/gentoo.pp
+++ b/manifests/plugins/gentoo.pp
@@ -1,4 +1,5 @@
-class munin::plugins::gentoo {
+# Set up the plugins for a gentoo host
+class munin::plugins::gentoo {
munin::plugin::deploy { 'gentoo_lastupdated':
config => "user portage\nenv.logfile /var/log/emerge.log\nenv.tail /usr/bin/tail\nenv.grep /bin/grep"
}
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp
index da89ed0..b92802b 100644
--- a/manifests/plugins/interfaces.pp
+++ b/manifests/plugins/interfaces.pp
@@ -1,25 +1,21 @@
# handle if_ and if_err_ plugins
-class munin::plugins::interfaces {
+class munin::plugins::interfaces {
+
+ $if_err_plugin = $::operatingsystem ? {
+ 'openbsd' => 'if_errcoll_',
+ default => 'if_err_',
+ }
# filter out many of the useless interfaces that show up
$real_ifs = reject(split($::interfaces, ' |,'), 'eth\d+_\d+|sit0|virbr\d+_nic|vif\d+_\d+|veth\d+|__tmp\d+')
- $ifs = regsubst($real_ifs, '(.+)', "if_\\1")
+ $ifs = regsubst($real_ifs, '(.+)', 'if_\1')
+ $if_errs = regsubst($real_ifs, '(.+)', "${if_err_plugin}\1")
- munin::plugin {
- $ifs: ensure => 'if_';
+ munin::plugin { $ifs:
+ ensure => 'if_',
}
- case $::operatingsystem {
- openbsd: {
- $if_errs = regsubst($real_ifs, '(.+)', "if_errcoll_\\1")
- munin::plugin{
- $if_errs: ensure => 'if_errcoll_';
- }
- }
- default: {
- $if_errs = regsubst($real_ifs, '(.+)', "if_err_\\1")
- munin::plugin{
- $if_errs: ensure => 'if_err_';
- }
- }
+
+ munin::plugin { $if_errs:
+ ensure => $if_err_plugin,
}
}
diff --git a/manifests/plugins/kvm.pp b/manifests/plugins/kvm.pp
index 7a1430f..650e5ef 100644
--- a/manifests/plugins/kvm.pp
+++ b/manifests/plugins/kvm.pp
@@ -1,3 +1,4 @@
+# Set up munin plugins for a KVM host
class munin::plugins::kvm {
munin::plugin::deploy {
[ 'kvm_cpu', 'kvm_mem', 'kvm_net' ]:;
diff --git a/manifests/plugins/linux.pp b/manifests/plugins/linux.pp
index a73de63..57f2bba 100644
--- a/manifests/plugins/linux.pp
+++ b/manifests/plugins/linux.pp
@@ -1,8 +1,9 @@
-class munin::plugins::linux {
+# Set up plugins for a linux host
+class munin::plugins::linux {
munin::plugin {
- [ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]:
+ [ 'df_abs', 'forks', 'df_inode', 'irqstats', 'entropy', 'open_inodes' ]:
ensure => present;
- acpi:
+ 'acpi':
ensure => $::acpi_available;
}
}
diff --git a/manifests/plugins/muninhost.pp b/manifests/plugins/muninhost.pp
index e4fb87d..644adb6 100644
--- a/manifests/plugins/muninhost.pp
+++ b/manifests/plugins/muninhost.pp
@@ -1,3 +1,4 @@
-class munin::plugins::muninhost {
+# Set up the plugins for a munin host
+class munin::plugins::muninhost {
munin::plugin { ['munin_update', 'munin_graph']: }
}
diff --git a/manifests/plugins/openbsd.pp b/manifests/plugins/openbsd.pp
index b549994..c195a1d 100644
--- a/manifests/plugins/openbsd.pp
+++ b/manifests/plugins/openbsd.pp
@@ -1,6 +1,7 @@
-class munin::plugins::openbsd {
+# Set up the plugins for an openbsd host
+class munin::plugins::openbsd {
munin::plugin {
- [ memory_pools, memory_types ]:
+ [ 'memory_pools', 'memory_types' ]:
ensure => present,
}
}
diff --git a/manifests/plugins/physical.pp b/manifests/plugins/physical.pp
index a1c27a7..b04845c 100644
--- a/manifests/plugins/physical.pp
+++ b/manifests/plugins/physical.pp
@@ -1,5 +1,7 @@
-class munin::plugins::physical {
+# Set up the plugins for a physical machine
+class munin::plugins::physical {
case $::kernel {
- linux: { munin::plugin { iostat: } }
+ linux: { munin::plugin { 'iostat': } }
+ default: {}
}
}
diff --git a/manifests/plugins/selinux.pp b/manifests/plugins/selinux.pp
index d094f35..9e03f0a 100644
--- a/manifests/plugins/selinux.pp
+++ b/manifests/plugins/selinux.pp
@@ -1,3 +1,4 @@
+# SELinux specific plugins
class munin::plugins::selinux {
munin::plugin{ [ 'selinux_avcstat' ]: }
}
diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp
index 197b657..e6210e9 100644
--- a/manifests/plugins/setup.pp
+++ b/manifests/plugins/setup.pp
@@ -1,3 +1,4 @@
+# Set up the munin plugins for a node
class munin::plugins::setup {
# This is required for the munin-node service and package requirements below.
@@ -5,10 +6,10 @@ class munin::plugins::setup {
file {
[ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]:
- ignore => 'snmp_*',
ensure => directory,
+ ignore => 'snmp_*',
checksum => mtime,
- recurse => true,
+ recurse => true,
purge => true,
force => true,
notify => Service['munin-node'],
diff --git a/manifests/plugins/vserver.pp b/manifests/plugins/vserver.pp
index e3eec05..5dc6431 100644
--- a/manifests/plugins/vserver.pp
+++ b/manifests/plugins/vserver.pp
@@ -1,7 +1,7 @@
+# vserver specific plugins
class munin::plugins::vserver {
munin::plugin {
- [ netstat, processes ]:
+ [ 'netstat', 'processes' ]:
ensure => present;
}
}
-
diff --git a/manifests/register.pp b/manifests/register.pp
index 309c322..1f6d787 100644
--- a/manifests/register.pp
+++ b/manifests/register.pp
@@ -1,3 +1,4 @@
+# Register a munin client
define munin::register (
$host = $::fqdn,
$port = '4949',
@@ -12,7 +13,7 @@ define munin::register (
@@concat::fragment{ "munin_client_${fhost}_${port}":
target => '/etc/munin/munin.conf',
- content => template("munin/client.erb"),
+ content => template('munin/client.erb'),
tag => $export_tag,
}
}
diff --git a/manifests/register/snmp.pp b/manifests/register/snmp.pp
index 78c3e91..06bb00b 100644
--- a/manifests/register/snmp.pp
+++ b/manifests/register/snmp.pp
@@ -1,3 +1,4 @@
+# Register a munin node with snmp enabled
define munin::register::snmp (
$community = 'public',
$description = 'absent',
@@ -10,12 +11,12 @@ define munin::register::snmp (
exec { "munin_register_snmp_${fhost}":
command => "munin-node-configure --snmp ${fhost} --snmpcommunity ${community} --shell | sh",
- unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null",
+ unless => "ls /etc/munin/plugins/snmp_${fhost}_* &> /dev/null",
}
@@concat::fragment{ "munin_snmp_${fhost}":
- target => '/etc/munin/munin.conf',
- content => template("munin/client.erb"),
- tag => 'munin',
+ target => '/etc/munin/munin.conf',
+ content => template('munin/client.erb'),
+ tag => 'munin',
}
}
diff --git a/manifests/remoteplugin.pp b/manifests/remoteplugin.pp
index 603cb66..a2abf69 100644
--- a/manifests/remoteplugin.pp
+++ b/manifests/remoteplugin.pp
@@ -1,16 +1,19 @@
-define munin::remoteplugin($ensure = "present", $source, $config = '') {
+# Configure a munin remote plugin
+define munin::remoteplugin($ensure = 'present', $source, $config = '') {
case $ensure {
- "absent": { munin::plugin{ $name: ensure => absent } }
+ 'absent': { munin::plugin{ $name: ensure => absent } }
default: {
file {
"/var/lib/puppet/modules/munin/plugins/${name}":
source => $source,
- mode => 0755, owner => root, group => 0;
+ mode => '0755',
+ owner => root,
+ group => 0,
}
munin::plugin { $name:
- ensure => $ensure,
- config => $config,
- script_path_in => "/var/lib/puppet/modules/munin/plugins",
+ ensure => $ensure,
+ config => $config,
+ script_path_in => '/var/lib/puppet/modules/munin/plugins',
}
}
}
diff --git a/manifests/snmp_collector.pp b/manifests/snmp_collector.pp
index 0f8318a..4ff3bf9 100644
--- a/manifests/snmp_collector.pp
+++ b/manifests/snmp_collector.pp
@@ -1,14 +1,17 @@
+# Set up munin as an SNMP collector
class munin::snmp_collector{
- file {
- "/var/lib/puppet/modules/munin/create_snmp_links":
- source => "puppet:///modules/munin/create_snmp_links.sh",
- mode => 755, owner => root, group => 0;
- }
+ file {
+ '/var/lib/puppet/modules/munin/create_snmp_links':
+ source => 'puppet:///modules/munin/create_snmp_links.sh',
+ mode => '0755',
+ owner => root,
+ group => 0,
+ }
- exec { "create_snmp_links":
- command => "/var/lib/puppet/modules/munin/create_snmp_links /var/lib/puppet/modules/munin/nodes",
- require => File["snmp_links"],
- timeout => "2048",
- schedule => daily
+ exec { 'create_snmp_links':
+ command => '/var/lib/puppet/modules/munin/create_snmp_links /var/lib/puppet/modules/munin/nodes',
+ require => File['snmp_links'],
+ timeout => '2048',
+ schedule => daily,
}
}