Ejemplo para cargar zonas de CloudFlare mediante Ansible

 


---
- hosts: cloudflare
vars:
do_token: vfsef9jo5gwyu3cbbfw787tb5qo272zitpfop
do_mail: [email protected]</code>

tasks:
- name: Registro Principal dominio.com
cloudflare_dns:
zone: dominio.com
type: A
value: 190.190.190.190
proxied: no
state: present
account_email: "{{ do_mail }}"
account_api_token: "{{ do_token }}"

- name: Sub Dominio sub.dominio.com
cloudflare_dns:
zone: dominio.com
record: sub
type: A
value: 190.190.190.190
proxied: no
state: present
account_email: "{{ do_mail }}"
account_api_token: "{{ do_token }}"

- name: Ejemplo CNAME otro.dominio.com
cloudflare_dns:
zone: dominio.com
record: otro
type: CNAME
value: 00000.ddns.net
proxied: no
account_email: "{{ do_mail }}"
account_api_token: "{{ do_token }}"

- name: Ejemplo MX
cloudflare_dns:
zone: dominio.com
type: MX
priority: 10
value: smtp.dominio.com
proxied: no
account_email: "{{ do_mail }}"
account_api_token: "{{ do_token }}"

- name: Ejemplo TXT SPF
cloudflare_dns:
zone: dominio.com
type: TXT
value: "v=spf1 a ip4:190.190.190.190 -all"
account_email: "{{ do_mail }}"
account_api_token: "{{ do_token }}"