ansible-role-bind9/tasks/verify_zone_file.yml
Markus Pesch 20bf0a7f9b
Some checks reported errors
continuous-integration/drone/push Build encountered an error
feat: support DNSSEC
2024-05-22 20:23:24 +02:00

14 lines
654 B
YAML

---
- name: "Read the last character of DNS zone: {{ zone.config.origin }}"
ansible.builtin.command:
cmd: "tail --bytes 1 {{ bind_config_directory + '/' + zone.file }}"
register: _bind9_zone_last_character
changed_when: _bind9_zone_last_character.rc == 0
failed_when: _bind9_zone_last_character.rc > 0
- name: "Fail when the last character of DNS zone file is not a newline: {{ bind_config_directory + '/' + zone.file }}"
ansible.builtin.fail:
msg: "Last character of DNS zone file is not a newline: {{ bind_config_directory + '/' + zone.file }}"
failed_when: _bind9_zone_last_character.stdout | regex_search('.+') | default(false)