config changes for bind

This commit is contained in:
rene
2022-03-24 13:45:18 +01:00
parent 745b50de21
commit abe744ba9c
4 changed files with 25 additions and 4 deletions

View File

@@ -1,4 +1,22 @@
- name: nameserver | bind | install packages
package:
name: "{{ bind_package }}"
state: present
state: present
- name: nameserver | bind | basic configuration
replace:
path: "{{ named_conf_options }}"
regexp:
replace: "{{ item.option }}"
validate: "{{ named_checkconf }} {{ named_conf_options }}"
loop:
- { regexp: '^\s*listen-on {(?:[\s\n]*(?:\d{1,3}\.){3}\d{1,3};)*[\s\n]*};', option: "\tlisten-on { {{ ansible_default_ipv4.address }}; };"}
- { regexp: '^\s*listen-on-v6 {(?:[\s\n]*(?:[\da-f:]*;)*[\s\n]*};', option: "\tlisten-on-v6 { {{ ansible_default_ipv6.address }}; };"}
lineinfile:
path: "{{ named_conf_options }}"
regexp: "{{ item.regexp }}"
state: present
line: "{{ item.option }}"
insertafter: "options {"