29 lines
703 B
YAML
29 lines
703 B
YAML
####################
|
|
# - Check Variables
|
|
####################
|
|
- name: "[Play] Check that mandatory variables are defined"
|
|
assert:
|
|
that:
|
|
- "domain is defined"
|
|
- "domain_to is defined"
|
|
|
|
####################
|
|
# - Set DNS CNAME Record => @
|
|
####################
|
|
- name: "Set DNS CNAME {{ domain_to }} => {{ domain_to }}"
|
|
cloudflare_dns:
|
|
api_token: "{{ cloudflare_dns_token }}"
|
|
|
|
zone: "{{ dns_root }}"
|
|
type: "CNAME"
|
|
|
|
record: "{{ domain }}"
|
|
value: "{{ domain_to }}"
|
|
|
|
- name: "Wait for DNS Propagation"
|
|
debug:
|
|
msg: "Waiting..."
|
|
until: "lookup('community.general.dig', domain) == lookup('community.general.dig', domain_to)"
|
|
retries: 30
|
|
delay: 10
|