diff --git a/packstack/plugins/puppet_950.py b/packstack/plugins/puppet_950.py index bed7f864b..731954137 100644 --- a/packstack/plugins/puppet_950.py +++ b/packstack/plugins/puppet_950.py @@ -191,7 +191,9 @@ def applyPuppetManifest(): running_logfile = "%s.running" % man_path finished_logfile = "%s.finished" % man_path 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("touch %s" % running_logfile) server.append("chmod 600 %s" % running_logfile) diff --git a/packstack/puppet/modules/apache b/packstack/puppet/modules/apache index 2e4ef5832..fbab9a521 160000 --- a/packstack/puppet/modules/apache +++ b/packstack/puppet/modules/apache @@ -1 +1 @@ -Subproject commit 2e4ef583212b6154739a0911378c1131892793c8 +Subproject commit fbab9a521dbd27a6cd77476327636003261d553c diff --git a/packstack/puppet/templates/horizon.pp b/packstack/puppet/templates/horizon.pp index 12709bc62..39b69856d 100644 --- a/packstack/puppet/templates/horizon.pp +++ b/packstack/puppet/templates/horizon.pp @@ -18,10 +18,12 @@ class {'horizon': class {'memcached':} 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/nagios.conf':} -file { '/etc/httpd/conf.d/php.conf':} firewall { '001 horizon incoming': proto => 'tcp', diff --git a/packstack/puppet/templates/nagios_server.pp b/packstack/puppet/templates/nagios_server.pp index 8714025c9..e2e01d75d 100644 --- a/packstack/puppet/templates/nagios_server.pp +++ b/packstack/puppet/templates/nagios_server.pp @@ -11,6 +11,15 @@ file { 'resource-d': 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(){ file{['/etc/nagios/resource.d/nagios_command.cfg', '/etc/nagios/resource.d/nagios_host.cfg']: ensure => 'present', @@ -58,7 +67,16 @@ class{'nagios_configs': 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, hasstatus => true, }