Skip to content

Commit 35649ae

Browse files
committed
Make stack.sh work on SUSE
This adds packages to suse for systemd python linkages as well as apache2 and which. And configures mod_proxy and mod_proxy_uwsgi with a2enmod. We also properly query if apache mods are enabled to avoid running into systemd service restart limits. Enable mod_version across the board as we use it and it may not be enabled by default (like in SUSE). Also in addition to enabling mod_ssl we enable the SSL flag so that TLS will work... Finally we tell the system to trust the devstack CA. Change-Id: I3442cebfb2e7c2550733eb95a12fab42e1229ce7
1 parent 9b2a2fa commit 35649ae

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

files/rpms-suse/general

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
apache2
2+
apache2-devel
13
bc
24
bridge-utils
35
ca-certificates-mozilla
@@ -23,9 +25,11 @@ python-cmd2 # dist:opensuse-12.3
2325
python-devel # pyOpenSSL
2426
python-xml
2527
screen
28+
systemd-devel # for systemd-python
2629
tar
2730
tcpdump
2831
unzip
2932
util-linux
3033
wget
34+
which
3135
zlib-devel

lib/apache

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ APACHE_LOG_DIR="/var/log/${APACHE_NAME}"
5353
function enable_apache_mod {
5454
local mod=$1
5555
# Apache installation, because we mark it NOPRIME
56-
if is_ubuntu || is_suse ; then
57-
if ! a2query -m $mod ; then
56+
if is_ubuntu; then
57+
# Skip mod_version as it is not a valid mod to enable
58+
# on debuntu, instead it is built in.
59+
if [[ "$mod" != "version" ]] && ! a2query -m $mod ; then
60+
sudo a2enmod $mod
61+
restart_apache_server
62+
fi
63+
elif is_suse; then
64+
if ! a2enmod -q $mod ; then
5865
sudo a2enmod $mod
5966
restart_apache_server
6067
fi
@@ -96,7 +103,7 @@ function install_apache_uwsgi {
96103
# delete the temp directory
97104
sudo rm -rf $dir
98105

99-
if is_ubuntu; then
106+
if is_ubuntu || is_suse ; then
100107
# we've got to enable proxy and proxy_uwsgi for this to work
101108
sudo a2enmod proxy
102109
sudo a2enmod proxy_uwsgi
@@ -171,6 +178,8 @@ function apache_site_config_for {
171178
# enable_apache_site() - Enable a particular apache site
172179
function enable_apache_site {
173180
local site=$@
181+
# Many of our sites use mod version. Just enable it.
182+
enable_apache_mod version
174183
if is_ubuntu; then
175184
sudo a2ensite ${site}
176185
elif is_fedora || is_suse; then

lib/tls

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ function init_CA {
212212
if is_fedora; then
213213
sudo cp $INT_CA_DIR/ca-chain.pem /usr/share/pki/ca-trust-source/anchors/devstack-chain.pem
214214
sudo update-ca-trust
215+
elif is_suse; then
216+
sudo cp $INT_CA_DIR/ca-chain.pem /usr/share/pki/trust/anchors/devstack-chain.pem
217+
sudo update-ca-certificates
215218
elif is_ubuntu; then
216219
sudo cp $INT_CA_DIR/ca-chain.pem /usr/local/share/ca-certificates/devstack-int.crt
217220
sudo cp $ROOT_CA_DIR/cacert.pem /usr/local/share/ca-certificates/devstack-root.crt
@@ -354,6 +357,9 @@ function fix_system_ca_bundle_path {
354357
elif is_ubuntu; then
355358
sudo rm -f $capath
356359
sudo ln -s /etc/ssl/certs/ca-certificates.crt $capath
360+
elif is_suse; then
361+
sudo rm -f $capath
362+
sudo ln -s /etc/ssl/ca-bundle.pem $capath
357363
else
358364
echo "Don't know how to set the CA bundle, expect the install to fail."
359365
fi
@@ -416,6 +422,9 @@ function enable_mod_ssl {
416422

417423
if is_ubuntu; then
418424
sudo a2enmod ssl
425+
elif is_suse; then
426+
sudo a2enmod ssl
427+
sudo a2enflag SSL
419428
elif is_fedora; then
420429
# Fedora enables mod_ssl by default
421430
:
@@ -522,6 +531,9 @@ $listen_string
522531
LogFormat "%v %h %l %u %t \"%r\" %>s %b"
523532
</VirtualHost>
524533
EOF
534+
if is_suse ; then
535+
sudo a2enflag SSL
536+
fi
525537
for mod in ssl proxy proxy_http; do
526538
enable_apache_mod $mod
527539
done

0 commit comments

Comments
 (0)