diff --git a/README.md b/README.md index bda1991..5771dcf 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ Role Variables | dovecot_mysql_database | undefined | Database with MySQL to use | | dovecot_mysql_username | undefined | Username with read only rights | | dovecot_mysql_password | undefined | Password for read only user | +| dovecot_vhost | inventory_hostname | What mod_md certificate should be used for Dovecot | Dependencies ------------ diff --git a/defaults/main.yml b/defaults/main.yml index 9314ae9..a617721 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,2 +1,3 @@ --- -# defaults file for ensure_dovecot \ No newline at end of file +# defaults file for ensure_dovecot +dovecot_vhost: '{{ inventory_hostname }}' diff --git a/templates/Fedora/35/usr/lib/systemd/system/dovecot-copytls.service b/templates/Fedora/35/usr/lib/systemd/system/dovecot-copytls.service index 516df92..01546fb 100644 --- a/templates/Fedora/35/usr/lib/systemd/system/dovecot-copytls.service +++ b/templates/Fedora/35/usr/lib/systemd/system/dovecot-copytls.service @@ -4,7 +4,7 @@ Description=Copy TLS Certificates for Dovecot [Service] Type=oneshot ExecStartPre=mkdir -p /etc/dovecot/certificates -ExecStart=/bin/bash -lc 'cp /etc/httpd/md/domains/*/*.pem /etc/dovecot/certificates/' +ExecStart=/bin/bash -lc 'cp /etc/httpd/md/domains/{{ dovecot_vhost }}/*.pem /etc/dovecot/certificates/' ExecStartPost=chown -R root:root /etc/dovecot/certificates [Install]