Implement a common class to manage apache service

This patch introduces a new class, openstack_integration::apache, which
can be used to manage apache service in ci jobs.

Change-Id: I1d29662abe630f291fc4dbcb80d439d9e7388ce8
This commit is contained in:
Takashi Kajinami 2020-08-07 09:05:11 +09:00
parent bb26118ae1
commit fc3f5bfbd3
5 changed files with 31 additions and 88 deletions

View File

@ -14,28 +14,6 @@
# limitations under the License.
#
if ($::os['family'] == 'Debian') {
$wsgi_mod_package = 'libapache2-mod-wsgi-py3'
$wsgi_mod_lib = 'mod_wsgi.so'
}
elsif ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$wsgi_mod_package = 'python3-mod_wsgi'
$wsgi_mod_lib = 'mod_wsgi_python3.so'
}
if ($::os['family'] == 'Debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
include apache::params
class { 'apache':
mod_packages => merge($::apache::params::mod_packages, {
'wsgi' => $wsgi_mod_package,
}),
mod_libs => merge($::apache::params::mod_libs, {
'wsgi' => $wsgi_mod_lib,
})
}
}
if ($::os['name'] == 'Ubuntu') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
# FIXME(ykarel) Disable SSL until services are ready to work with SSL + Python3
@ -84,6 +62,7 @@ class { 'openstack_integration::config':
if $ssl {
include openstack_integration::cacert
}
include openstack_integration::apache
include openstack_integration::memcached
include openstack_integration::rabbitmq
if ($om_rpc == 'amqp') {

View File

@ -14,28 +14,6 @@
# limitations under the License.
#
if ($::os['family'] == 'Debian') {
$wsgi_mod_package = 'libapache2-mod-wsgi-py3'
$wsgi_mod_lib = 'mod_wsgi.so'
}
elsif ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$wsgi_mod_package = 'python3-mod_wsgi'
$wsgi_mod_lib = 'mod_wsgi_python3.so'
}
if ($::os['family'] == 'Debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
include apache::params
class { 'apache':
mod_packages => merge($::apache::params::mod_packages, {
'wsgi' => $wsgi_mod_package,
}),
mod_libs => merge($::apache::params::mod_libs, {
'wsgi' => $wsgi_mod_lib,
})
}
}
if ($::os['name'] == 'Ubuntu') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
# FIXME(ykarel) Disable SSL until services are ready to work with SSL + Python3
@ -67,6 +45,7 @@ class { 'openstack_integration::config':
if $ssl {
include openstack_integration::cacert
}
include openstack_integration::apache
include openstack_integration::memcached
include openstack_integration::rabbitmq
include openstack_integration::mysql

View File

@ -14,28 +14,6 @@
# limitations under the License.
#
if ($::os['family'] == 'Debian') {
$wsgi_mod_package = 'libapache2-mod-wsgi-py3'
$wsgi_mod_lib = 'mod_wsgi.so'
}
elsif ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$wsgi_mod_package = 'python3-mod_wsgi'
$wsgi_mod_lib = 'mod_wsgi_python3.so'
}
if ($::os['family'] == 'Debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
include apache::params
class { 'apache':
mod_packages => merge($::apache::params::mod_packages, {
'wsgi' => $wsgi_mod_package,
}),
mod_libs => merge($::apache::params::mod_libs, {
'wsgi' => $wsgi_mod_lib,
})
}
}
if ($::os['name'] == 'Ubuntu') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
# FIXME(ykarel) Disable SSL until services are ready to work with SSL + Python3
@ -92,6 +70,7 @@ class { 'openstack_integration::config':
if $ssl {
include openstack_integration::cacert
}
include openstack_integration::apache
include openstack_integration::memcached
include openstack_integration::rabbitmq
include openstack_integration::mysql

View File

@ -14,28 +14,6 @@
# limitations under the License.
#
if ($::os['family'] == 'Debian') {
$wsgi_mod_package = 'libapache2-mod-wsgi-py3'
$wsgi_mod_lib = 'mod_wsgi.so'
}
elsif ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$wsgi_mod_package = 'python3-mod_wsgi'
$wsgi_mod_lib = 'mod_wsgi_python3.so'
}
if ($::os['family'] == 'Debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
include apache::params
class { 'apache':
mod_packages => merge($::apache::params::mod_packages, {
'wsgi' => $wsgi_mod_package,
}),
mod_libs => merge($::apache::params::mod_libs, {
'wsgi' => $wsgi_mod_lib,
})
}
}
if ($::os['name'] == 'Ubuntu') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
# FIXME(ykarel) Disable SSL until services are ready to work with SSL + Python3
@ -80,6 +58,7 @@ class { 'openstack_integration::config':
if $ssl {
include openstack_integration::cacert
}
include openstack_integration::apache
include openstack_integration::memcached
include openstack_integration::rabbitmq
include openstack_integration::mysql

27
manifests/apache.pp Normal file
View File

@ -0,0 +1,27 @@
class openstack_integration::apache {
include openstack_integration::params
include openstack_integration::config
if ($::os['family'] == 'Debian') {
$wsgi_mod_package = 'libapache2-mod-wsgi-py3'
$wsgi_mod_lib = 'mod_wsgi.so'
}
elsif ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$wsgi_mod_package = 'python3-mod_wsgi'
$wsgi_mod_lib = 'mod_wsgi_python3.so'
}
if ($::os['family'] == 'Debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
include apache::params
class { 'apache':
mod_packages => merge($::apache::params::mod_packages, {
'wsgi' => $wsgi_mod_package,
}),
mod_libs => merge($::apache::params::mod_libs, {
'wsgi' => $wsgi_mod_lib,
})
}
}
}