24 lines
703 B
YAML
24 lines
703 B
YAML
---
|
|
- name: "Send notify to all slaves for all domains"
|
|
hosts: master_nameservers
|
|
become: true
|
|
tasks:
|
|
- name: List all zones
|
|
ansible.builtin.command: pdnsutil list-all-zones
|
|
register: zones_output
|
|
changed_when: false
|
|
|
|
- name: Notify each zone
|
|
ansible.builtin.command: pdns_control notify {{ item }}
|
|
loop: "{{ zones_output.stdout_lines }}"
|
|
when: zones_output.stdout_lines | length > 0
|
|
changed_when: true
|
|
- name: "Refresh all zones knot"
|
|
hosts: slave_nameservers
|
|
become: true
|
|
tasks:
|
|
- name: List all zones
|
|
ansible.builtin.command: knotc zone-retransfer
|
|
register: retransfer_output
|
|
changed_when: retransfer_output.rc == 0
|