From 20dd8f27004a5dac0ad68113f4b8038cb34bc791 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 5 Nov 2015 21:13:31 +0100 Subject: [bug] [jessie] Load needed modules for apache 2.4 - Related: #6920 --- puppet/modules/site_nagios/manifests/server/apache.pp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'puppet/modules/site_nagios/manifests/server') diff --git a/puppet/modules/site_nagios/manifests/server/apache.pp b/puppet/modules/site_nagios/manifests/server/apache.pp index 8dbc7e9b..7de477cd 100644 --- a/puppet/modules/site_nagios/manifests/server/apache.pp +++ b/puppet/modules/site_nagios/manifests/server/apache.pp @@ -1,7 +1,25 @@ +# set up apache for nagios class site_nagios::server::apache { + include x509::variables + include site_config::x509::commercial::cert include site_config::x509::commercial::key include site_config::x509::commercial::ca + include apache::module::authn_file + # "AuthUserFile" + include apache::module::authz_user + # "AuthType Basic" + include apache::module::auth_basic + # "DirectoryIndex" + include apache::module::dir + include apache::module::php5 + include apache::module::cgi + + # apache >= 2.4, debian jessie + if ( versioncmp($::apache_version, '2.4') >= 0 ) { + include apache::module::authn_core + } + } -- cgit v1.2.3 From 5e78892e07d94d3d3da8d97fef9d67a15297070d Mon Sep 17 00:00:00 2001 From: varac Date: Mon, 16 Nov 2015 13:46:35 +0100 Subject: [bug] use $lsbdistcodename to query apache version Using $::apache_version won't work because the facts are evaluated before compiling the catalog and with this, before the installation of apache. so on an install from scratch, this fact won't contain anything. --- puppet/modules/site_nagios/manifests/server/apache.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'puppet/modules/site_nagios/manifests/server') diff --git a/puppet/modules/site_nagios/manifests/server/apache.pp b/puppet/modules/site_nagios/manifests/server/apache.pp index 7de477cd..82962e89 100644 --- a/puppet/modules/site_nagios/manifests/server/apache.pp +++ b/puppet/modules/site_nagios/manifests/server/apache.pp @@ -18,7 +18,7 @@ class site_nagios::server::apache { include apache::module::cgi # apache >= 2.4, debian jessie - if ( versioncmp($::apache_version, '2.4') >= 0 ) { + if ( $::lsbdistcodename == 'jessie' ) { include apache::module::authn_core } -- cgit v1.2.3 From ee4fc33396aa52f9ec797fd431b3027d88fa1aa7 Mon Sep 17 00:00:00 2001 From: varac Date: Wed, 2 Mar 2016 13:03:12 +0100 Subject: Dont recreate nagios resources on every run Use purging of nagios resources in a way that not all resources are recreated on every puppetrun. Resolves: #2327 --- .../modules/site_nagios/manifests/server/hostgroup.pp | 5 ++++- puppet/modules/site_nagios/manifests/server/purge.pp | 19 ------------------- 2 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 puppet/modules/site_nagios/manifests/server/purge.pp (limited to 'puppet/modules/site_nagios/manifests/server') diff --git a/puppet/modules/site_nagios/manifests/server/hostgroup.pp b/puppet/modules/site_nagios/manifests/server/hostgroup.pp index 6f85ca6d..25623924 100644 --- a/puppet/modules/site_nagios/manifests/server/hostgroup.pp +++ b/puppet/modules/site_nagios/manifests/server/hostgroup.pp @@ -1,3 +1,6 @@ +# create a nagios hostsgroup define site_nagios::server::hostgroup ($contact_emails) { - nagios_hostgroup { $name: } + nagios_hostgroup { $name: + ensure => present + } } diff --git a/puppet/modules/site_nagios/manifests/server/purge.pp b/puppet/modules/site_nagios/manifests/server/purge.pp deleted file mode 100644 index 6815a703..00000000 --- a/puppet/modules/site_nagios/manifests/server/purge.pp +++ /dev/null @@ -1,19 +0,0 @@ -class site_nagios::server::purge inherits nagios::base { - # we don't want to get /etc/nagios3 and /etc/nagios3/conf.d - # purged, cause the check-mk-config-nagios3 package - # places its templates in /etc/nagios3/conf.d/check_mk, - # and check_mk -O updated it's nagios config in /etc/nagios3/conf.d/check_mk - File['nagios_cfgdir'] { - purge => false - } - File['nagios_confd'] { - purge => false - } - - # only purge files in the /etc/nagios3/conf.d/ dir, not in any subdir - exec {'purge_conf.d': - command => '/usr/bin/find /etc/nagios3/conf.d/ -maxdepth 1 -type f -exec rm {} \;', - onlyif => '/usr/bin/find /etc/nagios3/conf.d/ -maxdepth 1 -type f | grep -q "/etc/nagios3/conf.d"', - require => Package['nagios'] - } -} -- cgit v1.2.3 From 91251fd30a7b1e5baa17aeff932d8bd13c370d8a Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 10 Mar 2016 13:52:06 +0100 Subject: Add Dependencies to site_nagios resources --- puppet/modules/site_nagios/manifests/server/add_contacts.pp | 4 +++- puppet/modules/site_nagios/manifests/server/contactgroup.pp | 4 +++- puppet/modules/site_nagios/manifests/server/hostgroup.pp | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) (limited to 'puppet/modules/site_nagios/manifests/server') diff --git a/puppet/modules/site_nagios/manifests/server/add_contacts.pp b/puppet/modules/site_nagios/manifests/server/add_contacts.pp index db507abf..b5c6f0a5 100644 --- a/puppet/modules/site_nagios/manifests/server/add_contacts.pp +++ b/puppet/modules/site_nagios/manifests/server/add_contacts.pp @@ -1,3 +1,4 @@ +# configure a nagios_contact define site_nagios::server::add_contacts ($contact_emails) { $environment = $name @@ -11,6 +12,7 @@ define site_nagios::server::add_contacts ($contact_emails) { host_notification_options => 'd,r', service_notification_commands => 'notify-service-by-email', host_notification_commands => 'notify-host-by-email', - email => join($contact_emails, ', ') + email => join($contact_emails, ', '), + require => Package['nagios'] } } diff --git a/puppet/modules/site_nagios/manifests/server/contactgroup.pp b/puppet/modules/site_nagios/manifests/server/contactgroup.pp index 188c54f1..5e60dd06 100644 --- a/puppet/modules/site_nagios/manifests/server/contactgroup.pp +++ b/puppet/modules/site_nagios/manifests/server/contactgroup.pp @@ -1,6 +1,8 @@ +# configure a contactgroup define site_nagios::server::contactgroup ($contact_emails) { nagios_contactgroup { $name: - members => $name + members => $name, + require => Package['nagios'] } } diff --git a/puppet/modules/site_nagios/manifests/server/hostgroup.pp b/puppet/modules/site_nagios/manifests/server/hostgroup.pp index 25623924..0692fced 100644 --- a/puppet/modules/site_nagios/manifests/server/hostgroup.pp +++ b/puppet/modules/site_nagios/manifests/server/hostgroup.pp @@ -1,6 +1,7 @@ # create a nagios hostsgroup define site_nagios::server::hostgroup ($contact_emails) { nagios_hostgroup { $name: - ensure => present + ensure => present, + require => Package['nagios'] } } -- cgit v1.2.3