-working snmpd install and config changes (listen on all, set public community string)

This commit is contained in:
Pi
2019-02-19 16:06:39 -05:00
parent a325f9798c
commit 21e246b07f
2 changed files with 8 additions and 2 deletions

5
hosts
View File

@@ -8,6 +8,7 @@
192.168.100.2
192.168.201.2
192.168.200.163 ansible_user=ubuntu
192.168.201.3
[pi]
192.168.50.2
@@ -17,6 +18,7 @@
192.168.199.2
192.168.90.2
192.168.100.2
192.168.201.3
[smbclient]
192.168.50.2
@@ -32,3 +34,6 @@
[public]
192.168.201.2
[snmpd]
192.168.201.3

View File

@@ -11,11 +11,12 @@
- lineinfile:
path: /etc/snmp/snmpd.conf
state: present
backrefs: yes
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '[\s+]rocommunity public[\s+]-V[\s+]systemonly', line: ' rocommunity public' }
- { regexp: 'agentAddress[\s+]udp:127.0.0.1:161', line: 'agentAddress udp:161' }
- { regexp: '^\s+rocommunity\s+public\s+default\s+-V\s+systemonly', line: ' rocommunity public' }
- { regexp: '^agentAddress\s+udp:127.0.0.1:161', line: 'agentAddress udp:161' }
tags: configure_snmpd
become: true
- name: enable snmpd service and ensure it is not masked