Преглед на файлове

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…
Отказ
Запис