bind9-ansible-role/tasks/04-test-changes.yml

8 lines
386 B
YAML
Raw Normal View History

2021-12-27 20:58:01 +01:00
# Test if all defined zones are locally available and do a rollback if not
- name: "Test zone {{zone.name}}"
2021-12-27 21:43:33 +01:00
shell: "dig {{item.type | default('CNAME')}} {{ item.name | default('') + (item.name is defined | ternary('.', '')) + zone.name}} @localhost +short"
2021-12-27 20:58:01 +01:00
register: dig_result
changed_when: dig_result.rc != 0
failed_when: dig_result.rc != 0
2021-12-27 21:55:55 +01:00
with_items: "{{zone.records}}"