forked from infra/ansible
Create certficate config in mail role.
This commit is contained in:
parent
2732c1a4ca
commit
3bfa0391b1
@ -81,6 +81,10 @@
|
||||
notify: Run postmap
|
||||
tags: mail
|
||||
|
||||
- name: Configure certificate manager
|
||||
template: src=certs.j2 dest=/etc/acme/domains.d/{{ ansible_fqdn }}_mail.conf
|
||||
tags: mail
|
||||
|
||||
- name: Create razor directory structure
|
||||
command: razor-admin -create chdir=/var/lib/amavis creates=/var/lib/amavis/.razor
|
||||
become: yes
|
||||
|
27
roles/mail/templates/certs.j2
Normal file
27
roles/mail/templates/certs.j2
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
|
||||
{{ ansible_fqdn }}:
|
||||
- path: /etc/postfix/ssl/{{ ansible_fqdn }}.crt
|
||||
user: postfix
|
||||
group: postfix
|
||||
perm: '400'
|
||||
format: crt
|
||||
notify: 'service postfix reload'
|
||||
- path: /etc/postfix/ssl/{{ ansible_fqdn }}.key
|
||||
user: postfix
|
||||
group: postfix
|
||||
perm: '400'
|
||||
format: key
|
||||
notify: 'service postfix reload'
|
||||
- path: /etc/dovecot/ssl/{{ ansible_fqdn }}.crt
|
||||
user: dovecot
|
||||
group: dovecot
|
||||
perm: '400'
|
||||
format: crt
|
||||
notify: 'service dovecot reload'
|
||||
- path: /etc/dovecot/ssl/{{ ansible_fqdn }}.key
|
||||
user: dovecot
|
||||
group: dovecot
|
||||
perm: '400'
|
||||
format: key
|
||||
notify: 'service dovecot reload'
|
Loading…
Reference in New Issue
Block a user