Procházet zdrojové kódy

Merge pull request #591 from mikeashley/opendmarc-fix

Make opendmarc database setup more robust
Allen Riddell před 8 roky
rodič
revize
5b58673ef6

+ 0
- 3
roles/mailserver/handlers/main.yml Zobrazit soubor

19
 
19
 
20
 - name: restart rspamd
20
 - name: restart rspamd
21
   service: name=rspamd state=restarted
21
   service: name=rspamd 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

+ 1
- 1
roles/mailserver/tasks/main.yml Zobrazit soubor

1
 - include: postfix.yml tags=postfix
1
 - include: postfix.yml tags=postfix
2
 - include: dovecot.yml tags=dovecot
2
 - include: dovecot.yml tags=dovecot
3
 - include: opendkim.yml tags=opendkim
3
 - include: opendkim.yml tags=opendkim
4
-- include: opendmarc.yml tags=dmarc
4
+- include: opendmarc.yml tags=opendmarc
5
 - include: rspamd.yml tags=rspamd
5
 - include: rspamd.yml tags=rspamd
6
 - include: solr.yml tags=solr
6
 - include: solr.yml tags=solr
7
 - include: checkrbl.yml tags=checkrbl
7
 - include: checkrbl.yml tags=checkrbl

+ 5
- 1
roles/mailserver/tasks/opendmarc.yml Zobrazit soubor

39
 
39
 
40
 - name: Create database for OpenDMARC reports
40
 - name: Create database for OpenDMARC reports
41
   mysql_db: name={{ mail_db_opendmarc_database }} state=present
41
   mysql_db: name={{ mail_db_opendmarc_database }} state=present
42
-  notify: import opendmarc schema
42
+  register: db_created
43
+
44
+- name: Import opendmarc schema
45
+  mysql_db: name={{ mail_db_opendmarc_database }} state=import target=/usr/share/doc/opendmarc/schema.mysql
46
+  when: db_created.changed
43
 
47
 
44
 - name: Copy nightly OpenDMARC report generation script into place
48
 - name: Copy nightly OpenDMARC report generation script into place
45
   template: src=etc_opendmarc_report.sh.j2 dest=/etc/opendmarc/report.sh owner=root group=root mode="755"
49
   template: src=etc_opendmarc_report.sh.j2 dest=/etc/opendmarc/report.sh owner=root group=root mode="755"

Loading…
Zrušit
Uložit