diff options
author | varac <varacanero@zeromail.org> | 2015-04-10 16:04:12 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2015-04-10 16:04:12 +0200 |
commit | e338207a1a85c0ad94a4dd6023dcfb9713e422cf (patch) | |
tree | e4424fcbd21478c52ee370574205dae2980a2eba | |
parent | 22ec34bca99709c8542a817158b5e96249972645 (diff) | |
parent | 300f1d39682d47e7bcc66b82f21dec15bb41b4e9 (diff) |
Merge remote-tracking branch 'leap/master' into varac_master
-rw-r--r-- | files/pnp4nagios/apache.conf | 1 | ||||
-rw-r--r-- | lib/facter/mountpoints.rb | 28 | ||||
-rw-r--r-- | manifests/pnp4nagios.pp | 71 | ||||
-rw-r--r-- | manifests/pnp4nagios/popup.pp | 27 |
4 files changed, 72 insertions, 55 deletions
diff --git a/files/pnp4nagios/apache.conf b/files/pnp4nagios/apache.conf index 8f66756..816bf05 100644 --- a/files/pnp4nagios/apache.conf +++ b/files/pnp4nagios/apache.conf @@ -27,4 +27,5 @@ Alias /pnp4nagios "/usr/share/pnp4nagios/html" # Rewrite all other URLs to index.php/URL RewriteRule .* index.php/$0 [PT,L] </IfModule> + DirectoryIndex index.php </Directory> diff --git a/lib/facter/mountpoints.rb b/lib/facter/mountpoints.rb index c51e6e6..da2f2a9 100644 --- a/lib/facter/mountpoints.rb +++ b/lib/facter/mountpoints.rb @@ -12,21 +12,23 @@ 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 + setcode do + 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]) + 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 - devices.push(mount[0]) if not devices.include?(mount[0]) end else FileSystem.mounts.each do |m| diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 5ade74f..230772f 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -2,27 +2,32 @@ class nagios::pnp4nagios { include nagios::defaults::pnp4nagios package { 'pnp4nagios': - ensure => installed } + ensure => installed, + require => Package['nagios'] + } - # unfortunatly we can't use the nagios_host and nagios_service - # definition to define templates, so we need to copy a file here. - # see http://projects.reductivelabs.com/issues/1180 for this limitation + # unfortunatly i didn't find a way to use nagios_host and nagios_service definition, because + # imho puppet can't handle the "name" variable needed in these 2 definitions + # so we need to copy a file here. file { 'pnp4nagios-templates.cfg': - path => "${nagios::defaults::vars::int_cfgdir}/conf.d/pnp4nagios-templates.cfg", - source => [ 'puppet:///modules/site_nagios/pnp4nagios/pnp4nagios-templates.cfg', - 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg' ], - mode => '0644', - owner => root, - group => root, - notify => Service['nagios'], + path => "${nagios::defaults::vars::int_cfgdir}/conf.d/pnp4nagios-templates.cfg", + source => [ + 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-templates.cfg', + 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-templates.cfg' ], + mode => '0644', + owner => root, + group => root, + notify => Service['nagios'], + require => Package['pnp4nagios'], } file { 'apache.conf': path => '/etc/pnp4nagios/apache.conf', - source => [ 'puppet:///modules/site_nagios/pnp4nagios/apache.conf', - 'puppet:///modules/nagios/pnp4nagios/apache.conf' ], + source => [ + 'puppet:///modules/site-nagios/pnp4nagios/apache.conf', + 'puppet:///modules/nagios/pnp4nagios/apache.conf' ], mode => '0644', owner => root, group => root, @@ -33,31 +38,35 @@ class nagios::pnp4nagios { # run npcd as daemon file { '/etc/default/npcd': - path => '/etc/default/npcd', - source => [ 'puppet:///modules/site_nagios/pnp4nagios/npcd', - 'puppet:///modules/nagios/pnp4nagios/npcd' ], - mode => '0644', - owner => root, - group => root, - notify => Service['npcd']; + path => '/etc/default/npcd', + source => [ + 'puppet:///modules/site-nagios/pnp4nagios/npcd', + 'puppet:///modules/nagios/pnp4nagios/npcd' ], + mode => '0644', + owner => root, + group => root, + notify => Service['npcd'], + require => Package['pnp4nagios'], } service { 'npcd': - ensure => running, - enable => true, - hasstatus => true, - require => Package['pnp4nagios'], + ensure => running, + enable => true, + hasstatus => true, + require => Package['pnp4nagios'], } # modify action.gif file { '/usr/share/nagios3/htdocs/images/action.gif': - path => '/usr/share/nagios3/htdocs/images/action.gif', - source => [ 'puppet:///modules/site_nagios/pnp4nagios/action.gif', - 'puppet:///modules/nagios/pnp4nagios/action.gif' ], - mode => '0644', - owner => root, - group => root, - notify => Service['nagios']; + path => '/usr/share/nagios3/htdocs/images/action.gif', + source => [ + 'puppet:///modules/site-nagios/pnp4nagios/action.gif', + 'puppet:///modules/nagios/pnp4nagios/action.gif' ], + mode => '0644', + owner => root, + group => root, + notify => Service['nagios'], + require => Package['pnp4nagios'], } } diff --git a/manifests/pnp4nagios/popup.pp b/manifests/pnp4nagios/popup.pp index 0dc04b0..91136cc 100644 --- a/manifests/pnp4nagios/popup.pp +++ b/manifests/pnp4nagios/popup.pp @@ -1,19 +1,24 @@ -class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { +class nagios::pnp4nagios::popup inherits nagios::pnp4nagios { File['pnp4nagios-templates.cfg']{ - source => [ 'puppet:///modules/site_nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', - 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg' ], + source => [ + 'puppet:///modules/site-nagios/pnp4nagios/pnp4nagios-popup-templates.cfg', + 'puppet:///modules/nagios/pnp4nagios/pnp4nagios-popup-templates.cfg' ], } file { '/usr/share/nagios3/htdocs/ssi': - ensure => directory } + ensure => directory, + require => Package['nagios'], + } file { 'status-header.ssi': - path => '/usr/share/nagios3/htdocs/ssi/status-header.ssi', - source => [ 'puppet:///modules/site_nagios/pnp4nagios/status-header.ssi', - 'puppet:///modules/nagios/pnp4nagios/status-header.ssi' ], - mode => '0644', - owner => root, - group => root, - notify => Service['nagios'], + path => '/usr/share/nagios3/htdocs/ssi/status-header.ssi', + source => [ + 'puppet:///modules/site-nagios/pnp4nagios/status-header.ssi', + 'puppet:///modules/nagios/pnp4nagios/status-header.ssi'], + mode => '0644', + owner => root, + group => root, + notify => Service['nagios'], + require => Package['nagios'], } } |