- nameserver: add named-checkconf wrapper that validates the edited fragment in
the context of the full named.conf (lineinfile validate needs %s; isolated
check fails on include-based configs) and surfaces BIND diagnostics on stderr
- base: make wireguard 'when' boolean-correct (ipaddr('public') returns a string)
- base/nameserver: skip step-ca import in base on nameservers (resolv.conf not
yet 127.0.0.1) and import it in the nameserver play after DNS setup
53 lines
1.4 KiB
YAML
Executable File
53 lines
1.4 KiB
YAML
Executable File
- name: nameserver | snmpd | install needed modules
|
|
package:
|
|
name: "{{ perl_readbackwards }}"
|
|
state: present
|
|
|
|
- name: nameserver | snmpd | get script
|
|
get_url:
|
|
url: "https://github.com/librenms/librenms-agent/raw/master/snmp/bind"
|
|
dest: "/etc/snmp/bind"
|
|
mode: "0755"
|
|
owner: "root"
|
|
group: "root"
|
|
|
|
- name: nameserver | snmpd | create configuration
|
|
copy:
|
|
dest: "/etc/snmp/bind.conf"
|
|
src: "snmpd_bind.conf"
|
|
mode: "0644"
|
|
owner: "root"
|
|
group: "root"
|
|
|
|
- name: nameserver | snmpd | create statistics file
|
|
file:
|
|
path: /var/cache/bind/stats
|
|
state: touch
|
|
owner: "bind"
|
|
group: "bind"
|
|
|
|
- name: nameserver | snmpd | deploy named-checkconf validation wrapper
|
|
copy:
|
|
dest: /usr/local/bin/named-checkconf-wrapper.sh
|
|
src: "named-checkconf-wrapper.sh"
|
|
mode: "0755"
|
|
owner: "root"
|
|
group: "root"
|
|
|
|
- name: nameserver | snmpd | configure named for statistics
|
|
lineinfile:
|
|
path: "{{ named_conf_options }}"
|
|
state: present
|
|
line: '\tstatistics-file "/var/cache/bind/stats";\n\tzone-statistics yes;'
|
|
insertafter: "options {"
|
|
validate: "/usr/local/bin/named-checkconf-wrapper.sh %s {{ named_conf }} {{ named_conf_options }} {{ named_checkconf }}"
|
|
notify: restart_named
|
|
|
|
- name: nameserver | snmpd | configure extend
|
|
lineinfile:
|
|
path: "{{ snmpd_conf }}"
|
|
state: present
|
|
line: "extend bind /etc/snmp/bind"
|
|
insertafter: "# SECTION: Extends"
|
|
notify: restart_snmpd
|