|
@@ -13,9 +13,18 @@ |
|
|
dest: /etc/opendkim.conf |
|
|
dest: /etc/opendkim.conf |
|
|
notify: reload opendkim |
|
|
notify: reload opendkim |
|
|
|
|
|
|
|
|
- name: dkim keys directory |
|
|
|
|
|
|
|
|
- name: opendkim config directory |
|
|
file: |
|
|
file: |
|
|
path: /etc/dkimkeys/{{item}} |
|
|
|
|
|
|
|
|
path: /etc/opendkim |
|
|
|
|
|
state: directory |
|
|
|
|
|
owner: opendkim |
|
|
|
|
|
group: opendkim |
|
|
|
|
|
mode: 0755 |
|
|
|
|
|
with_items: "{{dkim_domains}}" |
|
|
|
|
|
|
|
|
|
|
|
- name: dkim keys directories |
|
|
|
|
|
file: |
|
|
|
|
|
path: /etc/opendkim/keys/{{item}} |
|
|
state: directory |
|
|
state: directory |
|
|
owner: opendkim |
|
|
owner: opendkim |
|
|
group: opendkim |
|
|
group: opendkim |
|
@@ -24,7 +33,7 @@ |
|
|
|
|
|
|
|
|
- name: dkim private keys |
|
|
- name: dkim private keys |
|
|
openssl_privatekey: |
|
|
openssl_privatekey: |
|
|
path: /etc/dkimkeys/{{item}}/mail.private |
|
|
|
|
|
|
|
|
path: /etc/opendkim/keys/{{item}}/{{dkim_selector}}.private |
|
|
size: "{{opendkim_key_size}}" |
|
|
size: "{{opendkim_key_size}}" |
|
|
owner: opendkim |
|
|
owner: opendkim |
|
|
group: opendkim |
|
|
group: opendkim |
|
@@ -33,20 +42,46 @@ |
|
|
|
|
|
|
|
|
- name: dkim public keys |
|
|
- name: dkim public keys |
|
|
openssl_publickey: |
|
|
openssl_publickey: |
|
|
privatekey_path: /etc/dkimkeys/{{item}}/mail.private |
|
|
|
|
|
path: /etc/dkimkeys/{{item}}/mail.public |
|
|
|
|
|
|
|
|
privatekey_path: /etc/opendkim/keys/{{item}}/{{dkim_selector}}.private |
|
|
|
|
|
path: /etc/opendkim/keys/{{item}}/{{dkim_selector}}.public |
|
|
owner: opendkim |
|
|
owner: opendkim |
|
|
group: opendkim |
|
|
group: opendkim |
|
|
mode: 0600 |
|
|
mode: 0600 |
|
|
with_items: "{{dkim_domains}}" |
|
|
with_items: "{{dkim_domains}}" |
|
|
|
|
|
|
|
|
- name: read dkim public keys |
|
|
- name: read dkim public keys |
|
|
command: cat /etc/dkimkeys/{{item}}/mail.public |
|
|
|
|
|
|
|
|
command: cat /etc/opendkim/keys/{{item}}/{{dkim_selector}}.public |
|
|
with_items: "{{dkim_domains}}" |
|
|
with_items: "{{dkim_domains}}" |
|
|
changed_when: false |
|
|
changed_when: false |
|
|
register: _opendkim_read_public_key |
|
|
register: _opendkim_read_public_key |
|
|
|
|
|
|
|
|
- name: show dkim entries |
|
|
|
|
|
|
|
|
- name: show dkim dns records |
|
|
debug: |
|
|
debug: |
|
|
msg: "{{_dkim_public_keys}}" |
|
|
|
|
|
|
|
|
msg: "{{_dkim_dns_records}}" |
|
|
|
|
|
|
|
|
|
|
|
- name: test dkim dns records |
|
|
|
|
|
command: opendkim-testkey -v -d {{item}} -s {{dkim_selector}} -k /etc/opendkim/keys/{{item}}/{{dkim_selector}}.private |
|
|
|
|
|
changed_when: false |
|
|
with_items: "{{dkim_domains}}" |
|
|
with_items: "{{dkim_domains}}" |
|
|
|
|
|
|
|
|
|
|
|
- name: opendkim key table |
|
|
|
|
|
template: |
|
|
|
|
|
src: key.table.j2 |
|
|
|
|
|
dest: /etc/opendkim/key.table |
|
|
|
|
|
mode: 0600 |
|
|
|
|
|
|
|
|
|
|
|
- name: opendkim signing table |
|
|
|
|
|
template: |
|
|
|
|
|
src: signing.table.j2 |
|
|
|
|
|
dest: /etc/opendkim/signing.table |
|
|
|
|
|
mode: 0600 |
|
|
|
|
|
|
|
|
|
|
|
- name: opendkim signing table |
|
|
|
|
|
template: |
|
|
|
|
|
src: trusted.hosts.j2 |
|
|
|
|
|
dest: /etc/opendkim/trusted.hosts |
|
|
|
|
|
mode: 0600 |
|
|
|
|
|
|
|
|
|
|
|
- name: test opendkim configuration |
|
|
|
|
|
command: opendkim -n |
|
|
|
|
|
changed_when: false |