summaryrefslogtreecommitdiffstats
path: root/roles/MSA
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-07-10 05:05:46 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-07-10 05:05:46 +0200
commitd6ff0c078e6d70e50c888e016a8a8b9b0d8d7782 (patch)
tree03dc91145b2ccf5db868ca397e3029365fdbc50a /roles/MSA
parent37464e75e1863a89d757077400543dea7b9317ac (diff)
Postfix MX/MSA instances: put certs in the the instance's $config_directory.
Diffstat (limited to 'roles/MSA')
-rw-r--r--roles/MSA/tasks/main.yml10
-rw-r--r--roles/MSA/templates/etc/postfix/main.cf.j24
2 files changed, 11 insertions, 3 deletions
diff --git a/roles/MSA/tasks/main.yml b/roles/MSA/tasks/main.yml
index 1c34720..3068e1b 100644
--- a/roles/MSA/tasks/main.yml
+++ b/roles/MSA/tasks/main.yml
@@ -22,6 +22,14 @@
owner=root group=root
mode=0644
+- name: Create directory /etc/postfix/ssl
+ file: path=/etc/postfix-{{ postfix_instance[inst].name }}/ssl
+ state=directory
+ owner=root group=root
+ mode=0755
+ tags:
+ - genkey
+
- meta: flush_handlers
- name: Start Postfix
@@ -32,7 +40,7 @@
become: False
# `/usr/sbin/postmulti -i msa -x /usr/sbin/postconf -xh smtpd_tls_cert_file`
fetch_cmd: cmd="openssl x509 -noout -pubkey"
- stdin=/etc/postfix/ssl/smtp.fripost.org.pem
+ stdin=/etc/postfix-{{ postfix_instance[inst].name }}/ssl/smtp.fripost.org.pem
dest=certs/public/smtp.fripost.org.pub
tags:
- genkey
diff --git a/roles/MSA/templates/etc/postfix/main.cf.j2 b/roles/MSA/templates/etc/postfix/main.cf.j2
index e998f39..838135a 100644
--- a/roles/MSA/templates/etc/postfix/main.cf.j2
+++ b/roles/MSA/templates/etc/postfix/main.cf.j2
@@ -76,8 +76,8 @@ smtpd_tls_security_level = encrypt
smtpd_tls_ciphers = high
smtpd_tls_protocols = !SSLv2, !SSLv3
smtpd_tls_exclude_ciphers = EXPORT, LOW, MEDIUM, aNULL, eNULL, DES, RC4, MD5
-smtpd_tls_cert_file = /etc/postfix/ssl/smtp.fripost.org.pem
-smtpd_tls_key_file = /etc/postfix/ssl/smtp.fripost.org.key
+smtpd_tls_cert_file = $config_directory/ssl/smtp.fripost.org.pem
+smtpd_tls_key_file = $config_directory/ssl/smtp.fripost.org.key
smtpd_tls_dh1024_param_file = /etc/ssl/dhparams.pem
smtpd_tls_session_cache_database=
smtpd_tls_received_header = yes