Commit 031e214c authored by Cédric BRINER's avatar Cédric BRINER Committed by Cédric BRINER
Browse files

ecp (ldap.conf...)

parent 12414522
......@@ -1358,7 +1358,7 @@ EOF
sscp " mods-enabled/ssl.conf" /etc/apache2/mods-available/ssl.conf ${h}:/etc/apache2/mods-available/
# enable modules
echo -e " \e[34m- enable modules\e[0m"
for apache_module in info status ssl proxy_ajp; do
for apache_module in info status ssl proxy_ajp ldap authnz_ldap ; do
echo -e " \e[34m- ${apache_module}\e[0m"
ssh root@${h} "a2query -q -m ${apache_module} || a2enmod ${apache_module}" | indent 7
done
......@@ -1371,6 +1371,19 @@ EOF
echo -e " \e[34m- ${apache_conf}\e[0m"
ssh root@${h} "a2query -q -c security || a2enconf security" | indent 7
done
# configure ldap.conf
echo -e " \e[34m- configure ldap.conf by extracting data from unige.instance.properties.${h}\e[0m"
ldap_user='"'$(ssh root@${h} \
"grep -P 'idp.authn.LDAP.bindDN[\s|=]' /opt/shibboleth-idp/conf/unige.instance.properties.${h} \
| sed -E 's|^idp.authn.LDAP.bindDN\s*=\s*(\S.*+)$|\1|'")'"'
ldap_password='"'$(ssh root@${h} \
"grep idp.authn.LDAP.bindDNCredential /opt/shibboleth-idp/conf/unige.instance.properties.${h} \
| sed -E 's|^idp.authn.LDAP.bindDNCredential\s*=\s*(\S+)\s*$|\1|'")'"'
cat /etc/apache2/mods-available/ldap.conf \
| sed -E "s|(\s*AuthLDAPBindDN\s+)(.*)\$|\1$ldap_user|" \
| sed -E "s|(\s*AuthLDAPBindPassword\s+)(.*)\$|\1$ldap_password|" \
| ssh root@${h} " cat - > /etc/apache2/mods-available/ldap.conf"
# disable/enable site
echo -e " \e[34m- enable site\e[0m"
for apache_site in $(ssh root@${h} "ls -1 /etc/apache2/sites-enabled/*conf" | xargs -I@ basename @); do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment