No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

opendmarc.yml 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. - name: Install OpenDMARC milter and related packages
  2. apt: pkg={{ item }} state=installed update_cache=yes
  3. with_items:
  4. - postgresql
  5. - python-psycopg2
  6. - opendmarc
  7. - name: Copy OpenDMARC configuration file into place
  8. template: src=etc_opendmarc.conf.j2 dest=/etc/opendmarc.conf owner=root group=root
  9. notify: restart opendmarc
  10. - name: Create OpenDMARC configuration directory
  11. file: state=directory path=/etc/opendmarc
  12. - name: Copy OpenDMARC ignore hosts file into place
  13. template: src=etc_opendmarc_ignore.hosts.j2 dest=/etc/opendmarc/ignore.hosts owner=root group=root
  14. - name: Copy OpenDMARC defaults file into place
  15. copy: src=etc_default_opendmarc dest=/etc/default/opendmarc owner=root group=root
  16. notify:
  17. - restart opendmarc
  18. - restart postfix
  19. - name: Create database user for OpenDMARC reports
  20. postgresql_user: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ mail_db_opendmarc_username }} password="{{ mail_db_opendmarc_password }}" state=present
  21. - name: Create database for OpenDMARC reports
  22. postgresql_db: login_host=localhost login_user={{ db_admin_username }} login_password="{{ db_admin_password }}" name={{ mail_db_opendmarc_database }} state=present owner={{ mail_db_opendmarc_username }}
  23. - name: Copy OpenDMARC database schema file into place
  24. copy: src=etc_opendmarc_import.sql dest=/etc/opendmarc/import.sql owner=root group=root mode=0600
  25. notify: import sql opendmarc
  26. - name: Copy nightly OpenDMARC report generation script into place
  27. template: src=etc_opendmarc_report.sh.j2 dest=/etc/opendmarc/report.sh owner=root group=root mode="755"
  28. - name: Touch initial report dat file with correct permissions
  29. file: path=/var/run/opendmarc/opendmarc.dat state=touch owner=opendmarc group=opendmarc
  30. - name: Activate OpenDMARC report cronjob
  31. cron: name="OpenDMARC report" hour="2" minute="0" job="/bin/bash /etc/opendmarc/report.sh >> /var/log/opendmarc_report.log"