diff options
author | varac <varacanero@zeromail.org> | 2013-01-26 18:50:58 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2013-01-26 18:50:58 +0100 |
commit | 89029e4d8381531d582a9208c1a4e93003b99637 (patch) | |
tree | c4bf62ed2fa41ae5c421896bd8563b7be432af46 /manifests | |
parent | 256cf866cb3cc9e88e8cd89dd59ac24ab24e1366 (diff) |
make sure the nagios server package is installed first
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/base.pp | 36 | ||||
-rw-r--r-- | manifests/debian.pp | 7 |
2 files changed, 35 insertions, 8 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 0f8b777..c048bb5 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -23,7 +23,8 @@ class nagios::base { "puppet:///modules/nagios/configs/${::operatingsystem}/nagios.cfg", "puppet:///modules/nagios/configs/nagios.cfg" ], notify => Service['nagios'], - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => root, + require => Package['nagios'], } file { 'nagios_cgi_cfg': @@ -35,13 +36,15 @@ class nagios::base { "puppet:///modules/nagios/configs/cgi.cfg" ], mode => '0644', owner => 'root', group => 0, notify => Service['apache'], + require => Package['nagios'], } file { 'nagios_htpasswd': path => "${nagios::defaults::vars::int_cfgdir}/htpasswd.users", source => [ "puppet:///modules/site_nagios/htpasswd.users", "puppet:///modules/nagios/htpasswd.users" ], - mode => 0640, owner => root, group => apache; + mode => 0640, owner => root, group => apache, + require => Package['nagios'], } file { 'nagios_private': @@ -50,7 +53,8 @@ class nagios::base { purge => true, recurse => true, notify => Service['nagios'], - mode => '0750', owner => root, group => nagios; + mode => '0750', owner => root, group => nagios, + require => Package['nagios'], } file { 'nagios_private_resource_cfg': @@ -58,7 +62,8 @@ class nagios::base { source => [ "puppet:///modules/site_nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}", "puppet:///modules/nagios/configs/${::operatingsystem}/private/resource.cfg.${::architecture}" ], notify => Service['nagios'], - owner => root, group => nagios, mode => '0640'; + owner => root, group => nagios, mode => '0640', + require => Package['nagios'], } file { 'nagios_confd': @@ -67,7 +72,8 @@ class nagios::base { purge => true, recurse => true, notify => Service['nagios'], - mode => '0750', owner => root, group => nagios; + mode => '0750', owner => root, group => nagios, + require => Package['nagios'], } Nagios_command <<||>> Nagios_contactgroup <<||>> @@ -88,68 +94,82 @@ class nagios::base { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_command.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_contact <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contact.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_contactgroup <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contactgroup.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_host <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_host.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_hostdependency <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostdependency.cfg", notify => Service['nagios'], + require => Package['nagios'], } Nagios_hostescalation <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostescalation.cfg", notify => Service['nagios'], + require => Package['nagios'], } Nagios_hostextinfo <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostextinfo.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_hostgroup <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostgroup.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_service <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_service.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_servicegroup <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicegroup.cfg", notify => Service['nagios'], + require => Package['nagios'], } Nagios_servicedependency <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicedependency.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_serviceescalation <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceescalation.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_serviceextinfo <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceextinfo.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } Nagios_timeperiod <||> { target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_timeperiod.cfg", require => File['nagios_confd'], notify => Service['nagios'], + require => Package['nagios'], } file{[ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_command.cfg", @@ -170,7 +190,8 @@ class nagios::base { ensure => file, replace => false, notify => Service['nagios'], - mode => 0644, owner => root, group => 0; + mode => 0644, owner => root, group => 0, + require => Package['nagios'], } # manage nagios cfg files @@ -181,6 +202,7 @@ class nagios::base { recurse => true, purge => true, notify => Service['nagios'], - mode => 0755, owner => root, group => root; + mode => 0755, owner => root, group => root, + require => Package['nagios'], } } diff --git a/manifests/debian.pp b/manifests/debian.pp index 0f451e3..f26bd97 100644 --- a/manifests/debian.pp +++ b/manifests/debian.pp @@ -18,13 +18,15 @@ class nagios::debian inherits nagios::base { path => "${nagios::defaults::vars::int_cfgdir}/commands.cfg", ensure => present, notify => Service['nagios'], - mode => 0644, owner => root, group => root; + mode => 0644, owner => root, group => root, + require => Package['nagios'], } file { "${nagios::defaults::vars::int_cfgdir}/stylesheets": ensure => directory, purge => false, recurse => true, + require => Package['nagios'], } if $nagios::allow_external_cmd { @@ -33,16 +35,19 @@ class nagios::debian inherits nagios::base { unless => 'dpkg-statoverride --list nagios www-data 2710 /var/lib/nagios3/rw && dpkg-statoverride --list nagios nagios 751 /var/lib/nagios3', logoutput => false, notify => Service['nagios'], + require => Package['nagios'], } exec { 'nagios_external_cmd_perms_1': command => 'chmod 0751 /var/lib/nagios3 && chown nagios:nagios /var/lib/nagios3', unless => 'test "`stat -c "%a %U %G" /var/lib/nagios3`" = "751 nagios nagios"', notify => Service['nagios'], + require => Package['nagios'], } exec { 'nagios_external_cmd_perms_2': command => 'chmod 2751 /var/lib/nagios3/rw && chown nagios:www-data /var/lib/nagios3/rw', unless => 'test "`stat -c "%a %U %G" /var/lib/nagios3/rw`" = "2751 nagios www-data"', notify => Service['nagios'], + require => Package['nagios'], } } } |