1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- ---
- # Handy reference: http://stevejenkins.com/blog/2010/09/how-to-get-dkim-domainkeys-identified-mail-working-on-centos-5-5-and-postfix-using-opendkim/
-
- - name: Install OpenDKIM and related packages
- apt: pkg={{ item }} state=installed
- with_items:
- - opendkim
- - opendkim-tools
- tags:
- - dependencies
-
- - name: Create OpenDKIM config directory
- file: state=directory path=/etc/opendkim group=opendkim owner=opendkim
-
- - name: Create OpenDKIM key directories
- file: state=directory path=/etc/opendkim/keys/{{ item.name }} group=opendkim owner=opendkim
- with_items: "{{ mail_virtual_domains }}"
-
- - name: Generate OpenDKIM keys
- command: opendkim-genkey -r -d {{ item.name }} -D /etc/opendkim/keys/{{ item.name }}/ creates=/etc/opendkim/keys/{{ item.name }}/default.private
- with_items: "{{ mail_virtual_domains }}"
-
- - name: Put opendkim.conf into place
- copy: src=etc_opendkim.conf dest=/etc/opendkim.conf owner=opendkim group=opendkim
- notify:
- - restart opendkim
- - restart postfix
-
- - name: Put additional OpenDKIM configuration files into place
- template: src=etc_opendkim_{{ item }}.j2 dest=/etc/opendkim/{{ item }} owner=opendkim group=opendkim
- with_items:
- - KeyTable
- - SigningTable
- - TrustedHosts
- notify:
- - restart opendkim
- - restart postfix
-
- - name: Set OpenDKIM config directory permissions
- file: state=directory path=/etc/opendkim
- group=opendkim owner=opendkim mode=0700 recurse=yes
- notify:
- - restart opendkim
- - restart postfix
|