- hosts: localhost connection: local tasks: - tags: terraform copy: dest: ../../terraform/dns/vpn.tf content: | # Generated from ansible data {% for host, data in wireguard_wg0.hosts.items() %} resource "linode_domain_record" "vpn-{{ host }}" { domain_id = linode_domain.root.id name = "{{ host }}.vpn" record_type = "AAAA" target = "{{ data.ipv6 }}" } {% endfor %}