--- - 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 ~all\""