aboutsummaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-03-05 14:21:32 +0800
committerAaron LI <aly@aaronly.me>2018-03-14 11:35:08 +0800
commit5c392f6204e069a2ec41a378ec2d9fb0ebec3d0a (patch)
tree2985e812c94f14749e96f5387d288642d9c0873f /roles
parent3e86d350bbc02a6185643b9fb5e6c66fc0a8ca4b (diff)
downloadansible-dfly-vps-5c392f6204e069a2ec41a378ec2d9fb0ebec3d0a.tar.bz2
mail/opendkim: Fix tables templating; update config; add handler
Diffstat (limited to 'roles')
-rw-r--r--roles/mail/handlers/main.yml3
-rw-r--r--roles/mail/tasks/main.yml7
-rw-r--r--roles/mail/templates/opendkim.conf.j27
3 files changed, 9 insertions, 8 deletions
diff --git a/roles/mail/handlers/main.yml b/roles/mail/handlers/main.yml
new file mode 100644
index 0000000..a164e26
--- /dev/null
+++ b/roles/mail/handlers/main.yml
@@ -0,0 +1,3 @@
+---
+- name: reload-opendkim
+ command: rcreload milter-opendkim
diff --git a/roles/mail/tasks/main.yml b/roles/mail/tasks/main.yml
index 186417f..59f1b0c 100644
--- a/roles/mail/tasks/main.yml
+++ b/roles/mail/tasks/main.yml
@@ -22,18 +22,23 @@
- name: opendkim - generate tables
template:
src: "{{ item }}"
- dest: /usr/local/etc/mail/dkim/{{ item | basename | regex_replace('\\.zone\\.j2', '') }}
+ dest: /usr/local/etc/mail/dkim/{{ item | basename | regex_replace('\.j2', '') }}
with_items:
- dkim/KeyTable.j2
- dkim/SigningTable.j2
+ notify: reload-opendkim
tags: opendkim
- name: opendkim - generate config file
template:
src: opendkim.conf.j2
dest: /usr/local/etc/mail/opendkim.conf
+ notify: reload-opendkim
tags: opendkim
+- name: opendkim - enable and start
+ command: rcenable milter-opendkim
+
- name: postfix - set as mailer/MTA
file:
path: /etc/mail/mailer.conf
diff --git a/roles/mail/templates/opendkim.conf.j2 b/roles/mail/templates/opendkim.conf.j2
index 80aae02..c8ae3dd 100644
--- a/roles/mail/templates/opendkim.conf.j2
+++ b/roles/mail/templates/opendkim.conf.j2
@@ -91,13 +91,6 @@ Socket inet:{{ mail.dkim.port }}@localhost
#
#UMask 007
-# Userid userid
-#
-# Change to user "userid" before starting normal operation? May include
-# a group ID as well, separated from the userid by a colon.
-#
-UserID mailnull:mailnull
-
# Canonicalization hdrcanon[/bodycanon]
#
# Select canonicalizations to use when signing. If the "bodycanon" is