summaryrefslogtreecommitdiff
path: root/manifests/base.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-12-28 18:27:07 +0100
committermh <mh@immerda.ch>2013-12-28 18:27:07 +0100
commit803bfe67b7f214927aa97dde795d84f6d79ce300 (patch)
tree0fb639fe2b7a1c8bce63a5c272477125e3dcc986 /manifests/base.pp
parentf596ec1fb06acb70f0b385fc418217556bc35dc2 (diff)
linting
Diffstat (limited to 'manifests/base.pp')
-rw-r--r--manifests/base.pp366
1 files changed, 187 insertions, 179 deletions
diff --git a/manifests/base.pp b/manifests/base.pp
index 08aefb9..4c4f344 100644
--- a/manifests/base.pp
+++ b/manifests/base.pp
@@ -1,187 +1,195 @@
+# basic stuff for nagios
class nagios::base {
- # include the variables
- include nagios::defaults::vars
+ # include the variables
+ include nagios::defaults::vars
- package { 'nagios':
- alias => 'nagios',
- ensure => present,
- }
+ package { 'nagios':
+ ensure => present,
+ }
- service { 'nagios':
- ensure => running,
- enable => true,
- #hasstatus => true, #fixme!
- require => Package['nagios'],
- }
+ service { 'nagios':
+ ensure => running,
+ enable => $nagios::service_at_boot,
+ #hasstatus => true, #fixme!
+ require => Package['nagios'],
+ }
- # this file should contain all the nagios_puppet-paths:
- file { 'nagios_main_cfg':
- path => "${nagios::defaults::vars::int_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;
- }
+ # this file should contain all the nagios_puppet-paths:
+ file{
+ 'nagios_main_cfg':
+ path => "${nagios::defaults::vars::int_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'],
+ owner => root,
+ group => root,
+ mode => '0644';
+ 'nagios_cgi_cfg':
+ path => "${nagios::defaults::vars::int_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' ],
+ notify => Service['apache'],
+ owner => 'root',
+ group => 0,
+ mode => '0644';
+ 'nagios_htpasswd':
+ path => "${nagios::defaults::vars::int_cfgdir}/htpasswd.users",
+ source => ['puppet:///modules/site_nagios/htpasswd.users',
+ 'puppet:///modules/nagios/htpasswd.users' ],
+ owner => root,
+ group => apache,
+ mode => '0640';
+ 'nagios_private':
+ ensure => directory,
+ path => "${nagios::defaults::vars::int_cfgdir}/private/",
+ purge => true,
+ recurse => true,
+ notify => Service['nagios'],
+ owner => root,
+ group => nagios,
+ mode => '0750';
+ 'nagios_private_resource_cfg':
+ path => "${nagios::defaults::vars::int_cfgdir}/private/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';
+ 'nagios_confd':
+ ensure => directory,
+ path => "${nagios::defaults::vars::int_cfgdir}/conf.d/",
+ purge => true,
+ recurse => true,
+ notify => Service['nagios'],
+ owner => root,
+ group => nagios,
+ mode => '0750';
+ }
+ 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 <<||>>
- file { 'nagios_cgi_cfg':
- path => "${nagios::defaults::vars::int_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'],
- }
+ 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'],
+ }
- 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;
- }
+ file{[
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_command.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contact.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contactgroup.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_host.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostdependency.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostescalation.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostextinfo.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostgroup.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostgroupescalation.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_service.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicedependency.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceescalation.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceextinfo.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicegroup.cfg",
+ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_timeperiod.cfg" ]:
+ ensure => file,
+ replace => false,
+ notify => Service['nagios'],
+ owner => root,
+ group => 0,
+ mode => '0644';
+ }
- 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;
- }
-
- file { 'nagios_private_resource_cfg':
- path => "${nagios::defaults::vars::int_cfgdir}/private/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';
- }
-
- file { 'nagios_confd':
- path => "${nagios::defaults::vars::int_cfgdir}/conf.d/",
- ensure => directory,
- purge => true,
- recurse => true,
- notify => Service['nagios'],
- mode => '0750', owner => root, group => nagios;
- }
- 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'],
- }
-
- file{[ "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_command.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contact.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_contactgroup.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_host.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostdependency.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostescalation.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostextinfo.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostgroup.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_hostgroupescalation.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_service.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicedependency.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceescalation.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_serviceextinfo.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_servicegroup.cfg",
- "${nagios::defaults::vars::int_cfgdir}/conf.d/nagios_timeperiod.cfg" ]:
- ensure => file,
- replace => false,
- notify => Service['nagios'],
- mode => 0644, owner => root, group => 0;
- }
-
- # manage nagios cfg files
- # must be defined after exported resource overrides and cfg file defs
- file { 'nagios_cfgdir':
- path => "${nagios::defaults::vars::int_cfgdir}/",
- ensure => directory,
- recurse => true,
- purge => true,
- force => true,
- notify => Service['nagios'],
- mode => 0755, owner => root, group => root;
- }
+ # manage nagios cfg files
+ # must be defined after exported resource overrides and cfg file defs
+ file { 'nagios_cfgdir':
+ ensure => directory,
+ path => "${nagios::defaults::vars::int_cfgdir}/",
+ recurse => true,
+ purge => true,
+ force => true,
+ notify => Service['nagios'],
+ owner => root,
+ group => root,
+ mode => '0755';
+ }
}