- name:Fail if DNS SRV record missing (Ansible dig lookup)
fail:
msg:>-
It appears the DNS SRV record for {{ dns_srv_record_check.service_and_protocol }} on {{ dns_srv_record_check.domain }} is not set up correctly (the record is missing).
See the 'Configuring DNS' documentation for this playbook.
- name:Fail if DNS SRV record incorrect (Ansible dig lookup)
fail:
msg:>-
It appears the DNS SRV record for {{ dns_srv_record_check.service_and_protocol }} on {{ dns_srv_record_check.domain }} is not set up correctly.
Expected it to point to `{{ dns_srv_record_check.expected_target }}` (port {{ dns_srv_record_check.expected_port }}).
Found it pointing to `{{ lookup_dig_srv.target }}` (port {{ lookup_dig_srv.port }}).
See the 'Configuring DNS' documentation for this playbook.
when:"lookup_dig_srv is defined and (lookup_dig_srv.target != dns_srv_record_check.expected_target or lookup_dig_srv.port != dns_srv_record_check.expected_port)"
# We expect an answer like this:
# ;; ANSWER SECTION:
# _matrix._tcp.DOMAIN. 10800 IN SRV 10 0 8448 matrix.DOMAIN.
- name:Fail if DNS SRV record missing or incorrect (dig CLI tool)
Full response from the `dig` lookup was:{{result_cli_dig_srv }}
when:"lookup_dig_srv is not defined and (dns_srv_record_check.expected_port|string + ' ' + dns_srv_record_check.expected_target) not in result_cli_dig_srv.stdout"