Matrix Docker Ansible eploy
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 

26 řádky
1.6 KiB

  1. ---
  2. # This requires the dnspython library and will fail with a friendly error when unavailable.
  3. - name: Check DNS SRV record for {{ dns_srv_record_check.service_and_protocol }} on {{ dns_srv_record_check.domain }}
  4. set_fact:
  5. result_dig_srv: "{{ lookup('dig', (dns_srv_record_check.service_and_protocol + '.' + dns_srv_record_check.domain + '/SRV'), 'flat=0', wantlist=False) }}"
  6. - name: Fail if DNS SRV record missing
  7. fail:
  8. 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."
  9. when: "result_dig_srv == 'NXDOMAIN'"
  10. - name: Fail if DNS SRV record incorrect
  11. fail:
  12. msg: >
  13. 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.
  14. Expected it to point to `{{ dns_srv_record_check.expected_target }}` (port {{ dns_srv_record_check.expected_port }}).
  15. Found it pointing to `{{ result_dig_srv.target }}` (port {{ result_dig_srv.port }}).
  16. See the 'Configuring DNS' documentation for this playbook.
  17. when: "result_dig_srv.target != dns_srv_record_check.expected_target or result_dig_srv.port != dns_srv_record_check.expected_port"
  18. - name: Report correct DNS SRV record
  19. debug:
  20. msg: >
  21. The DNS SRV record for `{{ dns_srv_record_check.service_and_protocol }}` on `{{ dns_srv_record_check.domain }}`
  22. points to `{{ result_dig_srv.target }}` (port {{ dns_srv_record_check.expected_port }}), as expected