Keep role configuration namespaced and allow hosts to customize systemd startup. Co-authored-by: Copilot <copilot@github.com>
14 lines
618 B
YAML
14 lines
618 B
YAML
---
|
|
|
|
- name: "Read the last character of DNS zone: {{ zone.config.origin }}"
|
|
ansible.builtin.command:
|
|
cmd: "tail --bytes 1 {{ bind9_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: {{ bind9_config_directory + '/' + zone.file }}"
|
|
ansible.builtin.fail:
|
|
msg: "Last character of DNS zone file is not a newline: {{ bind9_config_directory + '/' + zone.file }}"
|
|
when: _bind9_zone_last_character.stdout != ''
|