Fixes for Nagios on F18

o load authn_core apache module
o load php module / package
o remove duplicate nagios enties

Change-Id: Icbfde8ccca467949dec5fb48f590c047c4152842
This commit is contained in:
Derek Higgins
2013-03-29 12:45:42 -04:00
parent 4706819db0
commit b7a41bb8e3
4 changed files with 26 additions and 4 deletions

View File

@@ -191,7 +191,9 @@ def applyPuppetManifest():
running_logfile = "%s.running" % man_path running_logfile = "%s.running" % man_path
finished_logfile = "%s.finished" % man_path finished_logfile = "%s.finished" % man_path
currently_running.append((hostname, finished_logfile)) currently_running.append((hostname, finished_logfile))
if not manifest.endswith('_horizon.pp'): # The apache puppet module doesn't work if we set FACTERLIB
# https://github.com/puppetlabs/puppetlabs-apache/pull/138
if not (manifest.endswith('_horizon.pp') or manifest.endswith('_nagios.pp')):
server.append("export FACTERLIB=$FACTERLIB:%s/facts" % host_dir) server.append("export FACTERLIB=$FACTERLIB:%s/facts" % host_dir)
server.append("touch %s" % running_logfile) server.append("touch %s" % running_logfile)
server.append("chmod 600 %s" % running_logfile) server.append("chmod 600 %s" % running_logfile)

View File

@@ -18,10 +18,12 @@ class {'horizon':
class {'memcached':} class {'memcached':}
class {'apache':} class {'apache':}
class {'apache::mod::php': }
class {'apache::mod::wsgi':} class {'apache::mod::wsgi':}
# The apache module purges files it doesn't know about
# avoid this be referencing them here
file { '/etc/httpd/conf.d/openstack-dashboard.conf':} file { '/etc/httpd/conf.d/openstack-dashboard.conf':}
file { '/etc/httpd/conf.d/nagios.conf':} file { '/etc/httpd/conf.d/nagios.conf':}
file { '/etc/httpd/conf.d/php.conf':}
firewall { '001 horizon incoming': firewall { '001 horizon incoming':
proto => 'tcp', proto => 'tcp',

View File

@@ -11,6 +11,15 @@ file { 'resource-d':
require => Package['nagios'] require => Package['nagios']
} }
# This is a Hack to remove the nagios config file before each run
# to work around a puppet bug http://projects.puppetlabs.com/issues/11921
# and prevent duplicate entries
exec{'rm-nagios-files':
path => ['/bin', '/usr/bin'],
command => ['rm -rf /etc/nagios/resource.d/nagios_command.cfg /etc/nagios/resource.d/nagios_host.cfg'],
before => Class['nagios_configs']
}
class nagios_configs(){ class nagios_configs(){
file{['/etc/nagios/resource.d/nagios_command.cfg', '/etc/nagios/resource.d/nagios_host.cfg']: file{['/etc/nagios/resource.d/nagios_command.cfg', '/etc/nagios/resource.d/nagios_host.cfg']:
ensure => 'present', ensure => 'present',
@@ -58,7 +67,16 @@ class{'nagios_configs':
notify => [Service['nagios'], Service['httpd']], notify => [Service['nagios'], Service['httpd']],
} }
service{['nagios', 'httpd']: class {'apache': }
class {'apache::mod::php': }
class {'apache::mod::wsgi':}
# The apache module purges files it doesn't know about
# avoid this be referencing them here
file { '/etc/httpd/conf.d/openstack-dashboard.conf':}
file { '/etc/httpd/conf.d/rootredirect.conf':}
file { '/etc/httpd/conf.d/nagios.conf':}
service{['nagios']:
ensure => running, ensure => running,
hasstatus => true, hasstatus => true,
} }