Additional fixes for RHEL 8 support

- pip install needs /usr as a prefix, otherwise packstack is installed
  under /usr/local/bin, which is not a valid path for sudo.
- iptables package is required.
- SSL certificates need to be decoded when writing, to avoid string
  issues.

Change-Id: Ia49ebda480ace91c6727c887c4cd8394cfefcfff
This commit is contained in:
Javier Pena 2019-02-19 11:52:26 +01:00
parent fe9620acd4
commit 316fad0d10
3 changed files with 9 additions and 8 deletions

View File

@ -140,11 +140,11 @@ def generate_ssl_cert(config, host, service, ssl_key_file, ssl_cert_file):
final_cert = crypto.dump_certificate(crypto.FILETYPE_PEM, cert)
final_key = crypto.dump_privatekey(crypto.FILETYPE_PEM, k)
deliver_ssl_file(ca_file, config['CONFIG_SSL_CACERT'], host)
deliver_ssl_file(final_cert, ssl_cert_file, host)
deliver_ssl_file(final_key, ssl_key_file, host)
deliver_ssl_file(final_cert.decode(), ssl_cert_file, host)
deliver_ssl_file(final_key.decode(), ssl_key_file, host)
with open(local_cert_path, 'w') as f:
f.write(final_cert)
f.write(final_cert.decode())
def deliver_ssl_file(content, path, host):

View File

@ -280,10 +280,10 @@ def create_self_signed_cert(config, messages):
cert.sign(k, 'sha1')
open((CERT_FILE), "wt").write(
crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
open((KEY_FILE), "wt").write(
crypto.dump_privatekey(crypto.FILETYPE_PEM, k))
open((CERT_FILE), "w").write(
crypto.dump_certificate(crypto.FILETYPE_PEM, cert).decode())
open((KEY_FILE), "w").write(
crypto.dump_privatekey(crypto.FILETYPE_PEM, k).decode())
messages.append(
"%sNOTE%s : A selfsigned CA certificate was generated to be used "

View File

@ -145,6 +145,7 @@ fi
# Install dependencies
$SUDO $PKG_MGR -y install puppet \
iproute \
iptables \
dstat \
openssl-devel \
libffi-devel \
@ -266,7 +267,7 @@ fi
# Setup packstack
if [ "${INSTALL_FROM_SOURCE}" = true ]; then
$SUDO $PIP install .
$SUDO $PIP install --prefix=/usr .
# In Fedora when running with sudo gems are installed at /usr/local/bin/ even when GEM_HOME/GEM_BIN_DIR are set
if [ "${PKG_MGR}" = "dnf" ]; then
export GEM_BIN_DIR=/usr/local/bin/