openstack-armada-app/openstack-helm/files/0007-Allow-more-generic-ove...

79 lines
2.5 KiB
Diff

From 17e0d2616389aabd4f07c561698fa4870b121bd4 Mon Sep 17 00:00:00 2001
From: Zhipeng Liu <zhipengs.liu@intel.com>
Date: Thu, 14 May 2020 06:20:38 +0000
Subject: [PATCH] Allow more generic overrides for placement.patch
Signed-off-by: Zhipeng Liu <zhipengs.liu@intel.com>
---
placement/templates/bin/_placement-api.sh.tpl | 21 +++++++++++++++++----
placement/values.yaml | 12 ++++++++++++
2 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/placement/templates/bin/_placement-api.sh.tpl b/placement/templates/bin/_placement-api.sh.tpl
index 5cd8918..7c5acb3 100644
--- a/placement/templates/bin/_placement-api.sh.tpl
+++ b/placement/templates/bin/_placement-api.sh.tpl
@@ -24,19 +24,32 @@ function start () {
cp -a $(type -p placement-api) /var/www/cgi-bin/placement/
if [ -f /etc/apache2/envvars ]; then
- # Loading Apache2 ENV variables
- source /etc/apache2/envvars
+ # Loading Apache2 ENV variables
+ source /etc/apache2/envvars
+ # The directory below has to be created due to the fact that
+ # libapache2-mod-wsgi-py3 doesn't create it in contrary by libapache2-mod-wsgi
+ mkdir -p ${APACHE_RUN_DIR}
fi
# Get rid of stale pid file if present.
rm -f /var/run/apache2/*.pid
# Start Apache2
- exec apache2ctl -DFOREGROUND
+ {{- if .Values.conf.software.apache2.a2enmod }}
+ {{- range .Values.conf.software.apache2.a2enmod }}
+ a2enmod {{ . }}
+ {{- end }}
+ {{- end }}
+ {{- if .Values.conf.software.apache2.a2dismod }}
+ {{- range .Values.conf.software.apache2.a2dismod }}
+ a2dismod {{ . }}
+ {{- end }}
+ {{- end }}
+ exec {{ .Values.conf.software.apache2.binary }} {{ .Values.conf.software.apache2.start_parameters }}
}
function stop () {
- apache2ctl -k graceful-stop
+ {{ .Values.conf.software.apache2.binary }} -k graceful-stop
}
$COMMAND
diff --git a/placement/values.yaml b/placement/values.yaml
index 9cff0dc..f16fd5d 100644
--- a/placement/values.yaml
+++ b/placement/values.yaml
@@ -65,6 +65,18 @@ conf:
segregation: 'rule:context_is_admin'
admin_or_owner: 'rule:context_is_admin or project_id:%(project_id)s'
default: 'rule:admin_or_owner'
+ software:
+ apache2:
+ binary: apache2
+ start_parameters: -DFOREGROUND
+ # Enable/Disable modules
+ # a2enmod:
+ # - headers
+ # - rewrite
+ # a2dismod:
+ # - status
+ a2enmod: null
+ a2dismod: null
placement:
DEFAULT:
debug: false
--
1.8.3.1