diff options
author | varac <varacanero@zeromail.org> | 2015-01-27 17:07:44 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2015-01-27 17:07:44 +0100 |
commit | aaf9e3df1c184c934f014f1003d8c2e2776b2b71 (patch) | |
tree | 074ce133686855ac9ac289d11bc46b9792acef21 /manifests | |
parent | 22ec34bca99709c8542a817158b5e96249972645 (diff) |
Nagios::Pnp4nagios should depend on installed nagios package (Bug #6660)
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/pnp4nagios.pp | 71 | ||||
-rw-r--r-- | manifests/pnp4nagios/popup.pp | 27 |
2 files changed, 56 insertions, 42 deletions
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'], } } |