From 72cd967a79c98f0a0e34cdce67576086cab10af6 Mon Sep 17 00:00:00 2001 From: VC Date: Sun, 1 Dec 2019 11:07:52 +0100 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20ce=20qu=E2=80=99il=20faut=20pour?= =?UTF-8?q?=20DMARC/DKIM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mail.yml | 1 + roles/opendkim/tasks/main.yml | 4 ++-- roles/opendkim/{files => templates}/opendkim.conf | 3 ++- roles/opendmarc/files/opendmarc.conf | 9 +++++++++ roles/opendmarc/handlers/main.yml | 4 ++++ roles/opendmarc/tasks/main.yml | 11 +++++++++++ 6 files changed, 29 insertions(+), 3 deletions(-) rename roles/opendkim/{files => templates}/opendkim.conf (76%) create mode 100644 roles/opendmarc/files/opendmarc.conf create mode 100644 roles/opendmarc/handlers/main.yml create mode 100644 roles/opendmarc/tasks/main.yml 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