-working snmpd install and config changes (listen on all, set public community string)
This commit is contained in:
5
hosts
5
hosts
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user