瀏覽代碼

Idempotency/changed-reporting fixes for OpenDMARC tasks.

Carl Meyer 8 年之前
父節點
當前提交
d46a9c47ef
共有 2 個檔案被更改,包括 6 行新增6 行删除
  1. 3
    0
      roles/mailserver/handlers/main.yml
  2. 3
    6
      roles/mailserver/tasks/opendmarc.yml

+ 3
- 0
roles/mailserver/handlers/main.yml 查看文件

@@ -19,3 +19,6 @@
19 19
 
20 20
 - name: restart rspamd
21 21
   service: name=rspamd.socket state=restarted
22
+
23
+- name: import opendmarc schema
24
+  mysql_db: name={{ mail_db_opendmarc_database }} state=import target=/usr/share/doc/opendmarc/schema.mysql

+ 3
- 6
roles/mailserver/tasks/opendmarc.yml 查看文件

@@ -26,16 +26,13 @@
26 26
 
27 27
 - name: Create database for OpenDMARC reports
28 28
   mysql_db: name={{ mail_db_opendmarc_database }} state=present
29
-
30
-- name: Import database schema for OpenDMARC reports
31
-  mysql_db: name={{ mail_db_opendmarc_database }} state=import target=/usr/share/doc/opendmarc/schema.mysql
32
-  tags: import_mysql_postfix
29
+  notify: import opendmarc schema
33 30
 
34 31
 - name: Copy nightly OpenDMARC report generation script into place
35 32
   template: src=etc_opendmarc_report.sh.j2 dest=/etc/opendmarc/report.sh owner=root group=root mode="755"
36 33
 
37
-- name: Touch initial report dat file with correct permissions
38
-  file: path=/var/run/opendmarc/opendmarc.dat state=touch owner=opendmarc group=opendmarc
34
+- name: Ensure initial report dat file exists with correct permissions
35
+  copy: content="" dest=/var/run/opendmarc/opendmarc.dat owner=opendmarc group=opendmarc
39 36
 
40 37
 - name: Activate OpenDMARC report cronjob
41 38
   cron: name="OpenDMARC report" hour="2" minute="0" job="/bin/bash /etc/opendmarc/report.sh >> /var/log/opendmarc_report.log 2>&1 || tail /var/log/opendmarc_report.log"

Loading…
取消
儲存