Add role mailserver_spf
This commit is contained in:
parent
998390668e
commit
67e70e7017
2 changed files with 17 additions and 0 deletions
|
@ -22,3 +22,5 @@
|
|||
tags: rspamd
|
||||
- role: mailserver_dkim
|
||||
tags: dkim
|
||||
- role: mailserver_spf
|
||||
tags: spf
|
||||
|
|
15
roles/mailserver_spf/tasks/main.yml
Normal file
15
roles/mailserver_spf/tasks/main.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
|
||||
- name: Get local public IP
|
||||
ansible.builtin.uri:
|
||||
url: "https://ipinfo.io/ip"
|
||||
return_content: true
|
||||
register: local_public_ip
|
||||
|
||||
- name: Set SPF TXT record
|
||||
ansible.builtin.set_fact:
|
||||
spf_txt_record: "{{ virtual_domain }}. IN TXT \"v=spf1 ip4:{{ local_public_ip.content }} mx a ~all\""
|
||||
|
||||
- name: Print SPF TXT record for the DNS zone
|
||||
ansible.builtin.debug:
|
||||
msg: "Don't forget to add this to your DNS zone:\n{{ spf_txt_record }}"
|
Loading…
Reference in a new issue