Files
ansible-role-bind9/tasks/verify_zone_file.yml
Markus Pesch 20b27e1e6b
All checks were successful
Ansible Linter / ansible-lint (push) Successful in 19s
Lint Markdown files / markdown-lint (push) Successful in 6s
fix(tasks): conditional result was 'None' of type 'NoneType'
2025-09-18 18:25:14 +02:00

14 lines
630 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 }}"
when: _bind9_zone_last_character.stdout | regex_search('.+')