diff --git a/mail.yml b/mail.yml index 8486cb0..2bdcb56 100644 --- a/mail.yml +++ b/mail.yml @@ -3,5 +3,6 @@ - postfix - dovecot - opendkim + - opendmarc - spamassassin - mailman diff --git a/roles/opendkim/tasks/main.yml b/roles/opendkim/tasks/main.yml index e5a89f0..ed9c6f0 100644 --- a/roles/opendkim/tasks/main.yml +++ b/roles/opendkim/tasks/main.yml @@ -7,8 +7,8 @@ - opendkim-tools - name: main configuration files - copy: - src: ./files/opendkim.conf + template: + src: opendkim.conf dest: /etc/opendkim.conf notify: - restart opendkim diff --git a/roles/opendkim/files/opendkim.conf b/roles/opendkim/templates/opendkim.conf similarity index 76% rename from roles/opendkim/files/opendkim.conf rename to roles/opendkim/templates/opendkim.conf index d3315a5..27490d1 100644 --- a/roles/opendkim/files/opendkim.conf +++ b/roles/opendkim/templates/opendkim.conf @@ -4,7 +4,8 @@ MilterDebug 1 Syslog yes UMask 002 OversignHeaders From - +Mode sv KeyTable /etc/dkim/KeyTable SigningTable /etc/dkim/SigningTable PidFile /var/run/opendkim/opendkim.pid +Nameservers {{ ansible_facts['dns']['nameservers']|join(',') }} diff --git a/roles/opendmarc/files/opendmarc.conf b/roles/opendmarc/files/opendmarc.conf new file mode 100644 index 0000000..7cdcbcb --- /dev/null +++ b/roles/opendmarc/files/opendmarc.conf @@ -0,0 +1,9 @@ +Socket inet:8892@localhost +FailureReports false +PidFile /var/run/opendmarc/opendmarc.pid +PublicSuffixList /usr/share/publicsuffix +RejectFailures false +Syslog true +SyslogFacility mail +UMask 0002 +UserID opendmarc diff --git a/roles/opendmarc/handlers/main.yml b/roles/opendmarc/handlers/main.yml new file mode 100644 index 0000000..0d41701 --- /dev/null +++ b/roles/opendmarc/handlers/main.yml @@ -0,0 +1,4 @@ +- name: restart opendmarc + service: + name: opendmarc + state: restarted diff --git a/roles/opendmarc/tasks/main.yml b/roles/opendmarc/tasks/main.yml new file mode 100644 index 0000000..bf235cc --- /dev/null +++ b/roles/opendmarc/tasks/main.yml @@ -0,0 +1,11 @@ +- name: install opendmarc + package: + name: opendmarc + state: present + +- name: opendmarc config file + copy: + src: ./files/opendmarc.conf + dest: /etc/opendmarc.conf + notify: + - restart opendmarc