@@ -50,6 +50,17 @@
- 'Restart opendkim'
when: with_opendkim
+- name: 'Install opendkim InternalHosts'
+ template:
+ src: 'opendkim/InternalHosts.j2'
+ dest: '/etc/opendkim/InternalHosts'
+ owner: 'root'
+ group: 'opendkim'
+ mode: '0640'
+ notify:
+ - 'Restart opendkim'
+ when: with_opendkim
+
- name: 'Install DKIM private keys'
copy:
content: "{{lookup('file', 'data/dkim/' + item + '.pem')}}"
@@ -0,0 +1,10 @@
+{% if ansible_prolog -%}
+{% from 'templates/ansible/prolog.j2' import prolog with context %}
+{{ prolog() }}
+{% endif -%}
+127.0.0.1
+{% if dkim_internal_hosts is defined %}
+{% for host in dkim_internal_hosts %}
+{{ host }}
+{% endfor %}
+{% endif %}
@@ -236,7 +236,7 @@ AlwaysAddARHeader yes
## hosts from which mail should be signed rather than verified.
## Automatically contains 127.0.0.1.
-# InternalHosts dataset
+InternalHosts file:/etc/opendkim/InternalHosts
## KeepTemporaryFiles { yes | no }
## default "no"