snmpd for bind
This commit is contained in:
44
roles/nameserver/tasks/configure_bind_snmpd.yml
Normal file
44
roles/nameserver/tasks/configure_bind_snmpd.yml
Normal file
@@ -0,0 +1,44 @@
|
||||
- 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: /etc/bind/named.stats
|
||||
state: touch
|
||||
owner: "bind"
|
||||
group: "bind"
|
||||
|
||||
- name: nameserver | snmpd | configure named for statistics
|
||||
lineinfile:
|
||||
path: "/etc/bind/named.conf.options" # required. The file to modify. Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name).
|
||||
state: present
|
||||
line: "statistics-file "/var/cache/bind/stats"; zone-statistics yes;"
|
||||
insertafter: "options {"
|
||||
validate: /usr/bin/named-checkconf %s
|
||||
notify: restart_named
|
||||
|
||||
- name: nameserver | snmpd | configure extend
|
||||
lineinfile:
|
||||
path: "/etc/snmp/snmpd.conf"
|
||||
state: present
|
||||
line: "extend bind /etc/snmp/bind"
|
||||
insertafter: "# SECTION: Extends"
|
||||
notify: restart_snmpd
|
||||
Reference in New Issue
Block a user