Enable selecting the TLS Certificate

This commit is contained in:
Jason Rothstein 2022-01-23 18:09:53 -06:00
parent 3173c6094d
commit d6be779113
3 changed files with 4 additions and 2 deletions

View File

@ -82,6 +82,7 @@ Role Variables
| dovecot_mysql_database | undefined | Database with MySQL to use | | dovecot_mysql_database | undefined | Database with MySQL to use |
| dovecot_mysql_username | undefined | Username with read only rights | | dovecot_mysql_username | undefined | Username with read only rights |
| dovecot_mysql_password | undefined | Password for read only user | | dovecot_mysql_password | undefined | Password for read only user |
| dovecot_vhost | inventory_hostname | What mod_md certificate should be used for Dovecot |
Dependencies Dependencies
------------ ------------

View File

@ -1,2 +1,3 @@
--- ---
# defaults file for ensure_dovecot # defaults file for ensure_dovecot
dovecot_vhost: '{{ inventory_hostname }}'

View File

@ -4,7 +4,7 @@ Description=Copy TLS Certificates for Dovecot
[Service] [Service]
Type=oneshot Type=oneshot
ExecStartPre=mkdir -p /etc/dovecot/certificates 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 ExecStartPost=chown -R root:root /etc/dovecot/certificates
[Install] [Install]