switch for snmpd interfaces
This commit is contained in:
@@ -39,12 +39,21 @@
|
|||||||
line: "rouser {{snmp_user }} authpriv"
|
line: "rouser {{snmp_user }} authpriv"
|
||||||
insertafter: "# SECTION: custom settings"
|
insertafter: "# SECTION: custom settings"
|
||||||
|
|
||||||
- name: server | snmpd | enable service on all interfaces
|
- name: server | snmpd | enable service on wireguard interface
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: "/etc/snmp/snmpd.conf"
|
path: "/etc/snmp/snmpd.conf"
|
||||||
regexp: "^agentaddress.*$"
|
regexp: "^agentaddress.*$"
|
||||||
state: present
|
state: present
|
||||||
line: "agentaddress 127.0.0.1,{{ wg_local_ip | ipaddr('address') }},[::1]"
|
line: "agentaddress 127.0.0.1,{{ wg_local_ip | ipaddr('address') }},[::1]"
|
||||||
|
when: wg_local_ip is defined
|
||||||
|
|
||||||
|
- name: server | snmpd | enable service on all interfaces
|
||||||
|
lineinfile:
|
||||||
|
path: "/etc/snmp/snmpd.conf"
|
||||||
|
regexp: "^agentaddress.*$"
|
||||||
|
state: present
|
||||||
|
line: "agentaddress udp:161,udp6:[::1]:161"
|
||||||
|
when: wg_local_ip is not defined
|
||||||
|
|
||||||
- name: server | snmpd start service
|
- name: server | snmpd start service
|
||||||
service:
|
service:
|
||||||
|
|||||||
Reference in New Issue
Block a user