ansible-role-bind9/tasks/template_zone_files.yml
Markus Pesch f8370dc77b
All checks were successful
continuous-integration/drone/push Build is passing
style(lint): quote mode
2023-02-26 22:22:07 +01:00

29 lines
794 B
YAML

---
- name: "Create directory for zone {{ zone.file | dirname }}"
ansible.builtin.file:
path: "{{ bind_config_directory }}/{{ zone.file | dirname }}"
owner: "{{ bind_unix_user }}"
group: "{{ bind_unix_group }}"
mode: "0755"
state: directory
with_items:
- "{{ view.zones }}"
loop_control:
loop_var: zone
when: zone.file is defined and zone.file | length > 0
- name: "Template view {{ view.name }}"
ansible.builtin.template:
src: "{{ inventory_hostname }}/etc/named/{{ zone.file }}.j2"
dest: "{{ bind_config_directory }}/{{ zone.file }}"
owner: "{{ bind_unix_user }}"
group: "{{ bind_unix_group }}"
mode: "0644"
with_items:
- "{{ view.zones }}"
loop_control:
loop_var: zone
when: zone.type == 'master'
notify: Restart named