configure snmp

This commit is contained in:
rene
2022-03-14 15:56:50 +01:00
parent 5f31cde7bb
commit 705a375617
5 changed files with 14 additions and 1 deletions

View File

@@ -0,0 +1 @@
snmp-user: Debian-snmp

View File

@@ -0,0 +1 @@
snmp-user: Debian-snmp

View File

@@ -0,0 +1 @@
Debian-snmp ALL = NOPASSWD: /etc/snmp/bind, /etc/snmp/fail2ban, /etc/snmp/docker-stats.sh, /etc/snmp/mailcow-dockerized-postfix

View File

@@ -5,6 +5,16 @@
name: "{{ snmpd_package }}" name: "{{ snmpd_package }}"
state: present state: present
- name: server | snmpd | install sudoers file
copy:
dest: "/etc/sudoers.d/10-debian-snmp"
src: "sudoers"
owner: "root"
group: "root"
mode: "0660"
validate: visudo -cf %s
when: ansible_distribution in ["Debian", "Ubuntu"]
- name: server | snmpd | insert anchors to snmpd.conf - name: server | snmpd | insert anchors to snmpd.conf
blockinfile: blockinfile:
path: "/etc/snmp/snmpd.conf" path: "/etc/snmp/snmpd.conf"

View File

@@ -10,6 +10,6 @@
lineinfile: lineinfile:
path: "/etc/snmp/snmpd.conf" path: "/etc/snmp/snmpd.conf"
state: present state: present
line: "extend bind /etc/snmp/nginx" line: "extend nginx /etc/snmp/nginx"
insertafter: "# SECTION: custom settings" insertafter: "# SECTION: custom settings"
notify: restart_snmpd notify: restart_snmpd