diff options
Diffstat (limited to 'manifests/base.pp')
-rw-r--r-- | manifests/base.pp | 200 |
1 files changed, 106 insertions, 94 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 3a0765a..687261d 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -22,9 +22,9 @@ class nagios::base { "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, + notify => Service['nagios'], require => Package['nagios'], + mode => 0644, owner => root, group => root; } file { 'nagios_cgi_cfg': @@ -43,27 +43,35 @@ class nagios::base { 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, require => Package['nagios'], + mode => 0640, owner => root, group => apache; } - file { 'nagios_private': - path => "${nagios::defaults::vars::int_cfgdir}/private/", - ensure => directory, - purge => true, - recurse => true, - notify => Service['nagios'], - mode => '0750', owner => root, group => nagios, - require => Package['nagios'], + if $::operatingsystem == 'Centos' { + file { 'nagios_private': + ensure => directory, + path => "${nagios::defaults::vars::int_cfgdir}/private/", + purge => true, + recurse => true, + mode => '0750', + owner => 'root', + group => 'nagios', + require => Package['nagios'], + notify => Service['nagios'], + } + + $resource_cfg_dir = "${nagios::defaults::vars::int_cfgdir}/private" + } + else { + $resource_cfg_dir = $nagios::defaults::vars::int_cfgdir } file { 'nagios_private_resource_cfg': - path => "${nagios::defaults::vars::int_cfgdir}/private/resource.cfg", + path => "${resource_cfg_dir}/resource.cfg", 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', - require => Package['nagios'], + owner => root, group => nagios, mode => '0640'; } file { 'nagios_confd': @@ -72,82 +80,91 @@ class nagios::base { purge => true, recurse => true, notify => Service['nagios'], - mode => '0750', owner => root, group => nagios, require => Package['nagios'], + mode => '0750', owner => root, group => nagios; } - if ( $nagios::stored_config == true ) { - include nagios::stored_config + Nagios_command <<||>> + Nagios_contactgroup <<||>> + Nagios_contact <<||>> + Nagios_hostdependency <<||>> + Nagios_hostescalation <<||>> + Nagios_hostextinfo <<||>> + Nagios_hostgroup <<||>> + Nagios_host <<||>> + Nagios_servicedependency <<||>> + Nagios_serviceescalation <<||>> + Nagios_servicegroup <<||>> + Nagios_serviceextinfo <<||>> + Nagios_service <<||>> + Nagios_timeperiod <<||>> + + Nagios_command <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_command.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_contact <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contact.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_contactgroup <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contactgroup.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_host <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_host.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_hostdependency <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostdependency.cfg", + notify => Service['nagios'], + } + Nagios_hostescalation <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostescalation.cfg", + notify => Service['nagios'], + } + Nagios_hostextinfo <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostextinfo.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_hostgroup <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostgroup.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_service <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_service.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_servicegroup <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicegroup.cfg", + notify => Service['nagios'], + } + Nagios_servicedependency <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicedependency.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_serviceescalation <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceescalation.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_serviceextinfo <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceextinfo.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], + } + Nagios_timeperiod <||> { + target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_timeperiod.cfg", + require => File['nagios_confd'], + notify => Service['nagios'], } - Nagios_command <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_command.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_contact <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contact.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_contactgroup <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contactgroup.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_host <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_host.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['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'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_hostgroup <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostgroup.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_service <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_service.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['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'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_serviceescalation <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceescalation.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_serviceextinfo <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceextinfo.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['nagios'], - } - Nagios_timeperiod <||> { - target => "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_timeperiod.cfg", - require => [ File['nagios_confd'], Package['nagios'] ], - notify => Service['nagios'], - } file{[ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_command.cfg", "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contact.cfg", @@ -167,8 +184,8 @@ class nagios::base { ensure => file, replace => false, notify => Service['nagios'], - mode => 0644, owner => root, group => 0, require => Package['nagios'], + mode => 0644, owner => root, group => 0; } # manage nagios cfg files @@ -179,12 +196,7 @@ class nagios::base { recurse => true, purge => true, notify => Service['nagios'], - mode => 0755, owner => root, group => root, require => Package['nagios'], + mode => 0755, owner => root, group => root; } - - file { [ '/usr/lib64', '/usr/lib64/nagios', '/usr/lib64/nagios/plugins/' ]: - ensure => directory - } - } |