Run the hook script immediately after installing it to generate the pem file for the mongodb server.

This commit is contained in:
Andrea Dell'Amico 2018-09-12 19:00:01 +02:00
parent 44ac051834
commit 303cb3a1e5
2 changed files with 4 additions and 1 deletions

View File

@ -6,6 +6,9 @@
- name: Install a script that fix the letsencrypt certificate for mongodb and then reload the service
template: src=mongodb-letsencrypt-acmetool.sh dest={{ letsencrypt_acme_services_scripts_dir }}/mongodb owner=root group=root mode=4555
- name: Copy the certificate and its key where the mongo server expects it
command: "{{ letsencrypt_acme_services_scripts_dir }}/mongodb"
when:
- mongodb_ssl_letsencrypt_managed
- letsencrypt_acme_install

View File

@ -1,7 +1,7 @@
#!/bin/bash
LE_CERTS_DIR=/etc/letsencrypt/live/$HOSTNAME
LE_LOG_DIR=/var/log/letsencrypt
LE_LOG_DIR=/var/log/acme
MONGODB_CERTDIR=/etc/pki/mongodb
MONGODB_CERTFILE=$MONGODB_CERTDIR/mongodb.pem
DATE=$( date )