self-hosting/roles/mailserver_dkim/handlers/main.yml

25 lines
690 B
YAML

---
- name: Save DKIM TXT record to a file
become: true
ansible.builtin.copy:
content: "{{ dkim_txt_record.stdout }}"
dest: "/var/lib/rspamd/dkim/{{ virtual_domain }}.{{ dkim_selector }}.dns"
owner: root
group: root
mode: "640"
- name: Add selector to DKIM selectors map
become: true
ansible.builtin.lineinfile:
path: /etc/rspamd/dkim_selectors.map
line: "{{ virtual_domain }} {{ dkim_selector }}"
create: true
owner: root
group: root
mode: "644"
notify: Reload rspamd service
- name: Print DKIM TXT record for the DNS zone
ansible.builtin.debug:
msg: "Don't forget to add this to your DNS zone:\n{{ dkim_txt_record.stdout }}"