diff options
-rw-r--r-- | files/configs/Debian/nagios.cfg | 1 | ||||
l--------- | files/configs/Debian/private/resource.cfg.amd64 | 1 | ||||
l---------[-rw-r--r--] | files/configs/Debian/private/resource.cfg.x86_64 | 32 | ||||
-rw-r--r-- | files/htpasswd.users | 0 | ||||
-rw-r--r-- | lib/facter/mountpoints.rb | 50 | ||||
-rw-r--r-- | manifests/apache.pp | 2 | ||||
-rw-r--r-- | manifests/base.pp | 111 | ||||
-rw-r--r-- | manifests/debian.pp | 2 | ||||
-rw-r--r-- | manifests/defaults/commands.pp | 2 | ||||
-rw-r--r-- | manifests/defaults/host_templates.pp | 12 | ||||
-rw-r--r-- | manifests/defaults/hostgroups.pp | 20 | ||||
-rw-r--r-- | manifests/defaults/service_templates.pp | 18 | ||||
-rw-r--r-- | manifests/defaults/templates.pp | 13 | ||||
-rw-r--r-- | manifests/defaults/vars.pp | 10 | ||||
-rw-r--r-- | manifests/nsca/client.pp | 6 | ||||
-rw-r--r-- | manifests/nsca/server.pp | 6 | ||||
-rw-r--r-- | manifests/plugin.pp | 9 |
17 files changed, 173 insertions, 122 deletions
diff --git a/files/configs/Debian/nagios.cfg b/files/configs/Debian/nagios.cfg index 377da6b..8eae393 100644 --- a/files/configs/Debian/nagios.cfg +++ b/files/configs/Debian/nagios.cfg @@ -20,6 +20,7 @@ log_file=/var/log/nagios3/nagios.log # host groups, contacts, contact groups, services, etc. # You can split your object definitions across several config files # if you wish (as shown below), or keep them all in a single config file. +cfg_file=/etc/nagios3/commands.cfg # Puppet-managed configuration files cfg_dir=/etc/nagios3/conf.d diff --git a/files/configs/Debian/private/resource.cfg.amd64 b/files/configs/Debian/private/resource.cfg.amd64 new file mode 120000 index 0000000..4d5f0a3 --- /dev/null +++ b/files/configs/Debian/private/resource.cfg.amd64 @@ -0,0 +1 @@ +resource.cfg.i386
\ No newline at end of file diff --git a/files/configs/Debian/private/resource.cfg.x86_64 b/files/configs/Debian/private/resource.cfg.x86_64 index 3ed732b..4d5f0a3 100644..120000 --- a/files/configs/Debian/private/resource.cfg.x86_64 +++ b/files/configs/Debian/private/resource.cfg.x86_64 @@ -1,31 +1 @@ -########################################################################### -# -# RESOURCE.CFG - Resource File for Nagios -# -# You can define $USERx$ macros in this file, which can in turn be used -# in command definitions in your host config file(s). $USERx$ macros are -# useful for storing sensitive information such as usernames, passwords, -# etc. They are also handy for specifying the path to plugins and -# event handlers - if you decide to move the plugins or event handlers to -# a different directory in the future, you can just update one or two -# $USERx$ macros, instead of modifying a lot of command definitions. -# -# The CGIs will not attempt to read the contents of resource files, so -# you can set restrictive permissions (600 or 660) on them. -# -# Nagios supports up to 32 $USERx$ macros ($USER1$ through $USER32$) -# -# Resource files may also be used to store configuration directives for -# external data sources like MySQL... -# -########################################################################### - -# Sets $USER1$ to be the path to the plugins -$USER1$=/usr/lib/nagios/plugins - -# Sets $USER2$ to be the path to event handlers -#$USER2$=/usr/lib/nagios/plugins/eventhandlers - -# Store some usernames and passwords (hidden from the CGIs) -#$USER3$=someuser -#$USER4$=somepassword +resource.cfg.i386
\ No newline at end of file diff --git a/files/htpasswd.users b/files/htpasswd.users new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/files/htpasswd.users diff --git a/lib/facter/mountpoints.rb b/lib/facter/mountpoints.rb new file mode 100644 index 0000000..c51e6e6 --- /dev/null +++ b/lib/facter/mountpoints.rb @@ -0,0 +1,50 @@ +begin + + mountpoints = [] + # we show devices, but we avoid outputing duplicate devices + devices = [] + Facter.add("mountpoints") do + ignorefs = ["NFS", "nfs", "nfs4", "nfsd", "afs", "binfmt_misc", "proc", "smbfs", + "autofs", "iso9660", "ncpfs", "coda", "devpts", "ftpfs", "devfs", + "mfs", "shfs", "sysfs", "cifs", "lustre_lite", "tmpfs", "usbfs", "udf", + "fusectl", "fuse.snapshotfs", "rpc_pipefs"] + begin + require 'filesystem' + rescue Exception => e + confine :kernel => :linux + ENV["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" + fs_source = nil + if FileTest.exists?("/etc/mtab") + fs_source = "/etc/mtab" + elsif FileTest.exists?("/proc/mounts") + fs_source = "/proc/mounts" + end + + mounts = File.read(fs_source).split("\n") + mounts.each do |mount| + mount = mount.split(" ") + if ((not ignorefs.include?(mount[2])) && (mount[3] !~ /bind/) && (not devices.include?(mount[0])) && (not mountpoints.include?(mount[1]))) + mountpoints.push(mount[1]) + end + devices.push(mount[0]) if not devices.include?(mount[0]) + end + else + FileSystem.mounts.each do |m| + if ((not ignorefs.include?(m.fstype)) && (m.options !~ /bind/) && !devices.include?(mount[0])) + mountpoints.push(m.mount) + end + devices.push(m.mount) if not devices.include?(m.mount) + end + end + setcode do + mountpoints.join(",") + end + end + Facter.add("devices") do + setcode do + devices.join(",") + end + end + +rescue Exception => e +end diff --git a/manifests/apache.pp b/manifests/apache.pp index 36994f8..c00b1d9 100644 --- a/manifests/apache.pp +++ b/manifests/apache.pp @@ -1,4 +1,4 @@ -class nagios::apache { +class nagios::apache inherits ::apache { $nagios_httpd = 'apache' include nagios } diff --git a/manifests/base.pp b/manifests/base.pp index 13e13fd..a32edcf 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -1,4 +1,6 @@ class nagios::base { + # include the variables + include nagios::defaults::vars package { 'nagios': alias => 'nagios', @@ -14,37 +16,37 @@ class nagios::base { # this file should contain all the nagios_puppet-paths: file { 'nagios_main_cfg': - path => "${nagios_cfgdir}/nagios.cfg", - source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/nagios.cfg", - "puppet://$server/modules/site-nagios/configs/${operatingsystem}/nagios.cfg", - "puppet://$server/modules/site-nagios/configs/nagios.cfg", - "puppet://$server/modules/nagios/configs/${operatingsystem}/nagios.cfg", - "puppet://$server/modules/nagios/configs/nagios.cfg" ], + path => "${nagios::defaults::vars::int_nagios_cfgdir}/nagios.cfg", + source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios.cfg", + "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios.cfg", + "puppet:///modules/site-nagios/configs/nagios.cfg", + "puppet:///modules/nagios/configs/${operatingsystem}/nagios.cfg", + "puppet:///modules/nagios/configs/nagios.cfg" ], notify => Service['nagios'], mode => 0644, owner => root, group => root; } file { 'nagios_cgi_cfg': - path => "${nagios_cfgdir}/cgi.cfg", - source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/cgi.cfg", - "puppet://$server/modules/site-nagios/configs/${operatingsystem}/cgi.cfg", - "puppet://$server/modules/site-nagios/configs/cgi.cfg", - "puppet://$server/modules/nagios/configs/${operatingsystem}/cgi.cfg", - "puppet://$server/modules/nagios/configs/cgi.cfg" ], + path => "${nagios::defaults::vars::int_nagios_cfgdir}/cgi.cfg", + source => [ "puppet:///modules/site-nagios/configs/${fqdn}/cgi.cfg", + "puppet:///modules/site-nagios/configs/${operatingsystem}/cgi.cfg", + "puppet:///modules/site-nagios/configs/cgi.cfg", + "puppet:///modules/nagios/configs/${operatingsystem}/cgi.cfg", + "puppet:///modules/nagios/configs/cgi.cfg" ], mode => '0644', owner => 'root', group => 0, notify => Service['apache'], } file { 'nagios_htpasswd': - path => "${nagios_cfgdir}/htpasswd.users", - source => [ "puppet://$server/modules/site-nagios/htpasswd.users", - "puppet://$server/modules/nagios/htpasswd.users" ], + path => "${nagios::defaults::vars::int_nagios_cfgdir}/htpasswd.users", + source => [ "puppet:///modules/site-nagios/htpasswd.users", + "puppet:///modules/nagios/htpasswd.users" ], mode => 0640, owner => root, group => apache; } file { 'nagios_private': - path => "${nagios_cfgdir}/private/", - source => "puppet://$server/modules/common/empty", + path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/", + source => "puppet:///modules/common/empty", ensure => directory, purge => true, recurse => true, @@ -53,16 +55,16 @@ class nagios::base { } file { 'nagios_private_resource_cfg': - path => "${nagios_cfgdir}/private/resource.cfg", - source => [ "puppet://$server/modules/nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}", - "puppet://$server/modules/site-nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}" ], + path => "${nagios::defaults::vars::int_nagios_cfgdir}/private/resource.cfg", + source => [ "puppet:///modules/nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}", + "puppet:///modules/site-nagios/configs/${operatingsystem}/private/resource.cfg.${architecture}" ], notify => Service['nagios'], owner => root, group => nagios, mode => '0640'; } file { 'nagios_confd': - path => "${nagios_cfgdir}/conf.d/", - source => "puppet://$server/modules/common/empty", + path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/", + source => "puppet:///modules/common/empty", ensure => directory, purge => true, recurse => true, @@ -84,68 +86,81 @@ class nagios::base { Nagios_serviceescalation <<||>> Nagios_serviceextinfo <<||>> Nagios_timeperiod <<||>> + File <<| tag == 'nagios_plugin' |>> Nagios_command <||> { - target => "${nagios_cfgdir}/conf.d/nagios_command.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_command.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_contact <||> { - target => "${nagios_cfgdir}/conf.d/nagios_contact.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contact.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_contactgroup <||> { - target => "${nagios_cfgdir}/conf.d/nagios_contactgroup.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contactgroup.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_host <||> { - target => "${nagios_cfgdir}/conf.d/nagios_host.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_host.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_hostextinfo <||> { - target => "${nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_hostgroup <||> { - target => "${nagios_cfgdir}/conf.d/nagios_hostgroup.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroup.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_hostgroupescalation <||> { - target => "${nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_service <||> { - target => "${nagios_cfgdir}/conf.d/nagios_service.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_service.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_servicedependency <||> { - target => "${nagios_cfgdir}/conf.d/nagios_servicedependency.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_servicedependency.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_serviceescalation <||> { - target => "${nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_serviceextinfo <||> { - target => "${nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } Nagios_timeperiod <||> { - target => "${nagios_cfgdir}/conf.d/nagios_timeperiod.cfg", + target => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_timeperiod.cfg", + require => File['nagios_confd'], notify => Service['nagios'], } - file{[ "${nagios_cfgdir}/conf.d/nagios_command.cfg", - "${nagios_cfgdir}/conf.d/nagios_contact.cfg", - "${nagios_cfgdir}/conf.d/nagios_contactgroup.cfg", - "${nagios_cfgdir}/conf.d/nagios_host.cfg", - "${nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg", - "${nagios_cfgdir}/conf.d/nagios_hostgroup.cfg", - "${nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg", - "${nagios_cfgdir}/conf.d/nagios_service.cfg", - "${nagios_cfgdir}/conf.d/nagios_servicedependency.cfg", - "${nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg", - "${nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg", - "${nagios_cfgdir}/conf.d/nagios_timeperiod.cfg" ]: + file{[ "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_command.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contact.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_contactgroup.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_host.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostextinfo.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroup.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_hostgroupescalation.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_service.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_servicedependency.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceescalation.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_serviceextinfo.cfg", + "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_timeperiod.cfg" ]: ensure => file, replace => false, notify => Service['nagios'], @@ -155,8 +170,8 @@ class nagios::base { # manage nagios cfg files # must be defined after exported resource overrides and cfg file defs file { 'nagios_cfgdir': - path => "${nagios_cfgdir}/", - source => "puppet://$server/modules/common/empty", + path => "${nagios::defaults::vars::int_nagios_cfgdir}/", + source => "puppet:///modules/common/empty", ensure => directory, recurse => true, purge => true, diff --git a/manifests/debian.pp b/manifests/debian.pp index a503324..b9e87ec 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -14,7 +14,7 @@ class nagios::debian inherits nagios::base { File['nagios_htpasswd', 'nagios_cgi_cfg'] { group => 'www-data' } - file { "${nagios_cfgdir}/stylesheets": + file { "${nagios::defaults::vars::int_nagios_cfgdir}/stylesheets": ensure => directory, purge => false, recurse => true, diff --git a/manifests/defaults/commands.pp b/manifests/defaults/commands.pp index 05460f5..bbb6ce5 100644 --- a/manifests/defaults/commands.pp +++ b/manifests/defaults/commands.pp @@ -49,7 +49,7 @@ class nagios::defaults::commands { command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -e'; check_ssh: command_line => '$USER1$/check_ssh $HOSTADDRESS$'; - check_ssh_port: + ssh_port: command_line => '$USER1$/check_ssh -p $ARG1$ $HOSTADDRESS$'; check_http: command_line => '$USER1$/check_http -H $HOSTADDRESS$ -I $HOSTADDRESS$'; diff --git a/manifests/defaults/host_templates.pp b/manifests/defaults/host_templates.pp index 699b965..0f47324 100644 --- a/manifests/defaults/host_templates.pp +++ b/manifests/defaults/host_templates.pp @@ -12,12 +12,12 @@ class nagios::defaults::host_templates { process_perf_data => '1', retain_status_information => '1', retain_nonstatus_information => '1', - check_command => 'check-host-alive', - max_check_attempts => '10', - notification_interval => '0', - notification_period => '24x7', - notification_options => 'd,u,r', - contact_groups => 'admins', + check_command => 'check-host-alive', + max_check_attempts => '10', + notification_interval => '0', + notification_period => '24x7', + notification_options => 'd,u,r', + contact_groups => 'admins', register => '0', } diff --git a/manifests/defaults/hostgroups.pp b/manifests/defaults/hostgroups.pp index 3a4f4d1..8715ade 100644 --- a/manifests/defaults/hostgroups.pp +++ b/manifests/defaults/hostgroups.pp @@ -1,13 +1,11 @@ class nagios::defaults::hostgroups { - - nagios_hostgroup { - 'all': - alias => 'All Servers', - members => '*'; - 'debian-servers': - alias => 'Debian GNU/Linux Servers'; - 'centos-servers': - alias => 'CentOS GNU/Linux Servers'; - } - + nagios_hostgroup { + 'all': + alias => 'All Servers', + members => '*'; + 'debian-servers': + alias => 'Debian GNU/Linux Servers'; + 'centos-servers': + alias => 'CentOS GNU/Linux Servers'; + } } diff --git a/manifests/defaults/service_templates.pp b/manifests/defaults/service_templates.pp index 326ce05..84740af 100644 --- a/manifests/defaults/service_templates.pp +++ b/manifests/defaults/service_templates.pp @@ -17,15 +17,15 @@ class nagios::defaults::service_templates { process_perf_data => '1', retain_status_information => '1', retain_nonstatus_information => '1', - notification_interval => '0', - is_volatile => '0', - check_period => '24x7', - normal_check_interval => '5', - retry_check_interval => '1', - max_check_attempts => '4', - notification_period => '24x7', - notification_options => 'w,u,c,r', - contact_groups => 'admins', + notification_interval => '0', + is_volatile => '0', + check_period => '24x7', + normal_check_interval => '5', + retry_check_interval => '1', + max_check_attempts => '4', + notification_period => '24x7', + notification_options => 'w,u,c,r', + contact_groups => 'admins', register => '0', } diff --git a/manifests/defaults/templates.pp b/manifests/defaults/templates.pp index 752ba60..c97eee4 100644 --- a/manifests/defaults/templates.pp +++ b/manifests/defaults/templates.pp @@ -1,12 +1,13 @@ class nagios::defaults::templates { + include nagios::defaults::vars file { 'nagios_templates': - path => "${nagios_cfgdir}/conf.d/nagios_templates.cfg", - source => [ "puppet://$server/modules/site-nagios/configs/${fqdn}/nagios_templates.cfg", - "puppet://$server/modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg", - "puppet://$server/modules/site-nagios/configs/nagios_templates.cfg", - "puppet://$server/modules/nagios/configs/${operatingsystem}/nagios_templates.cfg", - "puppet://$server/modules/nagios/configs/nagios_templates.cfg" ], + path => "${nagios::defaults::vars::int_nagios_cfgdir}/conf.d/nagios_templates.cfg", + source => [ "puppet:///modules/site-nagios/configs/${fqdn}/nagios_templates.cfg", + "puppet:///modules/site-nagios/configs/${operatingsystem}/nagios_templates.cfg", + "puppet:///modules/site-nagios/configs/nagios_templates.cfg", + "puppet:///modules/nagios/configs/${operatingsystem}/nagios_templates.cfg", + "puppet:///modules/nagios/configs/nagios_templates.cfg" ], notify => Service['nagios'], mode => 0644, owner => root, group => root; } diff --git a/manifests/defaults/vars.pp b/manifests/defaults/vars.pp new file mode 100644 index 0000000..6302f13 --- /dev/null +++ b/manifests/defaults/vars.pp @@ -0,0 +1,10 @@ +class nagios::defaults::vars { + case $nagios_cfgdir { + '': { $int_nagios_cfgdir = $operatingsystem ? { + centos => '/etc/nagios/', + default => '/etc/nagios3' + } + } + default: { $int_nagios_cfgdir = $nagios_cfgdir } + } +} diff --git a/manifests/nsca/client.pp b/manifests/nsca/client.pp index 5314b3d..6e2c472 100644 --- a/manifests/nsca/client.pp +++ b/manifests/nsca/client.pp @@ -3,9 +3,9 @@ class nagios::nsca::client { package { 'nsca': ensure => installed } file { '/etc/send_nsca.cfg': - source => [ "puppet://${server}/modules/site-nagios/nsca/{$fqdn}/send_nsca.cfg", - "puppet://${server}/modules/site-nagios/nsca/send_nsca.cfg", - "puppet://${server}/modules/nagios/nsca/send_nsca.cfg" ], + source => [ "puppet:///modules/site-nagios/nsca/{$fqdn}/send_nsca.cfg", + "puppet:///modules/site-nagios/nsca/send_nsca.cfg", + "puppet:///modules/nagios/nsca/send_nsca.cfg" ], owner => 'nagios', group => 'nogroup', mode => '400', diff --git a/manifests/nsca/server.pp b/manifests/nsca/server.pp index e1cb83c..9239f21 100644 --- a/manifests/nsca/server.pp +++ b/manifests/nsca/server.pp @@ -9,9 +9,9 @@ class nagios::nsca::server { } file { '/etc/nsca.cfg': - source => [ "puppet://${server}/modules/site-nagios/nsca/{$fqdn}/nsca.cfg", - "puppet://${server}/modules/site-nagios/nsca/nsca.cfg", - "puppet://${server}/modules/nagios/nsca/nsca.cfg" ], + source => [ "puppet:///modules/site-nagios/nsca/{$fqdn}/nsca.cfg", + "puppet:///modules/site-nagios/nsca/nsca.cfg", + "puppet:///modules/nagios/nsca/nsca.cfg" ], owner => 'nagios', group => 'nogroup', mode => '400', diff --git a/manifests/plugin.pp b/manifests/plugin.pp index 4789345..abaa6e5 100644 --- a/manifests/plugin.pp +++ b/manifests/plugin.pp @@ -1,13 +1,18 @@ define nagios::plugin( + $source = 'absent', $ensure = present ){ - file{$name: + @@file{$name: path => $hardwaremodel ? { 'x86_64' => "/usr/lib64/nagios/plugins/$name", default => "/usr/lib/nagios/plugins/$name", }, ensure => $ensure, - source => "puppet://$server/modules/nagios/plugins/$name", + source => $source ? { + 'absent' => "puppet:///modules/nagios/plugins/$name", + default => "puppet:///modules/$source" + }, + tag => 'nagios_plugin', require => Package['nagios-plugins'], owner => root, group => 0, mode => 0755; } |