From abe9445fb76d50b71f2549210a496601d23d5760 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Mon, 6 Jul 2015 13:20:32 -0400 Subject: [PATCH] Migrate to puppet-httpd module puppet-httpd is the openstack-infra version of puppetlabs-apache (0.0.4) release. This patchset will remove the puppetlabs-apache namespace from -infra allowing for possible future patchsets to use newer puppetlabs-apache modules. Change-Id: Ifcc60d173430e30159aa794e5adb5ba71107e647 Depends-On: I4f4648538801a60f45b28cedc73b24d8905cfe14 Depends-On: I2ecb0f5db76d9a13ddb89293e44b2f86fad1137c Signed-off-by: Paul Belanger --- manifests/logserver.pp | 99 +++++++++++++++++++++++++++++------------- metadata.json | 2 +- 2 files changed, 71 insertions(+), 30 deletions(-) diff --git a/manifests/logserver.pp b/manifests/logserver.pp index 245fe2d..6f9f7de 100644 --- a/manifests/logserver.pp +++ b/manifests/logserver.pp @@ -32,24 +32,81 @@ class openstackci::logserver ( } } - include apache - include apache::mod::wsgi + # NOTE(pabelanger): Until we full remove puppetlabs-apache from + # system-config, we need to do this hack to avoid a circular dependency. + if ! defined(Class['::apache']) { + include ::httpd + include ::httpd::mod::wsgi - if ! defined(A2mod['rewrite']) { - a2mod { 'rewrite': - ensure => present, + if ! defined(Httpd_mod['rewrite']) { + httpd_mod { 'rewrite': + ensure => present, + } } - } - if ! defined(A2mod['proxy']) { - a2mod { 'proxy': - ensure => present, + if ! defined(Httpd_mod['proxy']) { + httpd_mod { 'proxy': + ensure => present, + } } - } - if ! defined(A2mod['proxy_http']) { - a2mod { 'proxy_http': - ensure => present, + if ! defined(Httpd_mod['proxy_http']) { + httpd_mod { 'proxy_http': + ensure => present, + } + } + + ::httpd::vhost { "logs.${domain}": + port => 80, + priority => '50', + docroot => '/srv/static/logs', + require => File['/srv/static/logs'], + template => 'openstackci/logs.vhost.erb', + } + + ::httpd::vhost { "logs-dev.${domain}": + port => 80, + priority => '51', + docroot => '/srv/static/logs', + require => File['/srv/static/logs'], + template => 'openstackci/logs-dev.vhost.erb', + } + } else { + include apache + include apache::mod::wsgi + + if ! defined(A2mod['rewrite']) { + a2mod { 'rewrite': + ensure => present, + } + } + + if ! defined(A2mod['proxy']) { + a2mod { 'proxy': + ensure => present, + } + } + + if ! defined(A2mod['proxy_http']) { + a2mod { 'proxy_http': + ensure => present, + } + } + + apache::vhost { "logs.${domain}": + port => 80, + priority => '50', + docroot => '/srv/static/logs', + require => File['/srv/static/logs'], + template => 'openstackci/logs.vhost.erb', + } + + apache::vhost { "logs-dev.${domain}": + port => 80, + priority => '51', + docroot => '/srv/static/logs', + require => File['/srv/static/logs'], + template => 'openstackci/logs-dev.vhost.erb', } } @@ -59,22 +116,6 @@ class openstackci::logserver ( } } - apache::vhost { "logs.${domain}": - port => 80, - priority => '50', - docroot => '/srv/static/logs', - require => File['/srv/static/logs'], - template => 'openstackci/logs.vhost.erb', - } - - apache::vhost { "logs-dev.${domain}": - port => 80, - priority => '51', - docroot => '/srv/static/logs', - require => File['/srv/static/logs'], - template => 'openstackci/logs-dev.vhost.erb', - } - file { '/srv/static/logs': ensure => directory, owner => 'jenkins', diff --git a/metadata.json b/metadata.json index 04348a1..700b639 100644 --- a/metadata.json +++ b/metadata.json @@ -8,7 +8,7 @@ "project_page": "http://docs.openstack.org/infra/system-config/", "issues_url": "https://storyboard.openstack.org/#!/project/808", "dependencies": [ - { "name": "puppetlabs/apache" }, + { "name": "openstackinfra/httpd" }, { "name": "openstackinfra/vcsrepo" }, { "name": "openstackinfra/jenkins" }, { "name": "openstackinfra/zuul" },