2019-02-14 22:44:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
LE_LOG_DIR=/var/log/acme
|
|
|
|
LOG_FILE="$LE_LOG_DIR/ipa-server.log"
|
|
|
|
DATE=$( date )
|
2020-04-24 19:38:27 +02:00
|
|
|
LE_CERTS_DIR="{{ letsencrypt_acme_sh_certificates_install_path }}"
|
2019-02-14 22:44:29 +01:00
|
|
|
|
|
|
|
[ ! -d $LE_LOG_DIR ] && mkdir $LE_LOG_DIR
|
|
|
|
echo "$DATE" >> $LOG_FILE
|
|
|
|
|
|
|
|
krb_realm=$( grep realm /etc/ipa/default.conf | awk '{ print $3 }' )
|
|
|
|
|
|
|
|
/bin/cp -f "$LE_CERTS_DIR/fullchain" /etc/pki/ipa/cert.pem
|
|
|
|
/bin/cp -f "$LE_CERTS_DIR/privkey" /etc/pki/ipa/cert-key.pem
|
2020-04-24 16:16:17 +02:00
|
|
|
chmod 400 /etc/pki/ipa/cert-key.pem
|
2019-02-14 22:44:29 +01:00
|
|
|
|
2020-03-31 23:20:52 +02:00
|
|
|
ipa-server-certinstall -w -d /etc/pki/ipa/cert.pem /etc/pki/ipa/cert-key.pem --pin='' -p '{{ ipa_manager_password }}'
|
2019-02-14 22:44:29 +01:00
|
|
|
systemctl reload httpd
|
|
|
|
systemctl restart "dirsrv@${krb_realm//./-}.service"
|
|
|
|
|
|
|
|
echo "Done." >> $LOG_FILE
|
|
|
|
|
|
|
|
exit 0
|