From 12d56691034b8edc730fa042fdfac0fe65f7a647 Mon Sep 17 00:00:00 2001 From: erus Date: Sat, 26 Jan 2019 21:49:59 -0300 Subject: [PATCH] Add CentOS support in devstack federation plugin Modify the install_federation function for adding Shibboleth repo and installation for CentOS in federation.sh, and also modify uninstall_federation function for removing Shibboleth packages when running `./unstack.sh`. Partial-bug: #1757000 Change-Id: I8c0f63d0a4fe19eab58e7cba3c49905f35266f9d --- devstack/lib/federation.sh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/devstack/lib/federation.sh b/devstack/lib/federation.sh index 774b7c2717..d4acc7ec69 100644 --- a/devstack/lib/federation.sh +++ b/devstack/lib/federation.sh @@ -66,10 +66,24 @@ function install_federation { # Enable the Shibboleth module for Apache sudo a2enmod shib2 - else + elif is_fedora; then # NOTE(knikolla): For CentOS/RHEL, installing shibboleth is tricky # It requires adding a separate repo not officially supported - echo "Skipping installation of shibboleth for non ubuntu host" + + # Add Shibboleth repository with curl + curl https://download.opensuse.org/repositories/security://shibboleth/CentOS_7/security:shibboleth.repo \ + | sudo tee /etc/yum.repos.d/shibboleth.repo >/dev/null + + # Install Shibboleth + install_package shibboleth + + # Create a new keypair for Shibboleth + sudo /etc/shibboleth/keygen.sh -f -o /etc/shibboleth + + # Start Shibboleth module + start_service shibd + else + echo "Skipping installation of shibboleth for non ubuntu nor fedora host" fi } @@ -153,7 +167,12 @@ function configure_tests_settings { function uninstall_federation { if is_ubuntu; then uninstall_package libapache2-mod-shib2 + elif is_fedora; then + uninstall_package shibboleth + + # Remove Shibboleth repository + sudo rm /etc/yum.repos.d/shibboleth.repo else - echo "Skipping uninstallation of shibboleth for non ubuntu host" + echo "Skipping uninstallation of shibboleth for non ubuntu nor fedora host" fi }