-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.100.2
|
||||||
192.168.201.2
|
192.168.201.2
|
||||||
192.168.200.163 ansible_user=ubuntu
|
192.168.200.163 ansible_user=ubuntu
|
||||||
|
192.168.201.3
|
||||||
|
|
||||||
[pi]
|
[pi]
|
||||||
192.168.50.2
|
192.168.50.2
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
192.168.199.2
|
192.168.199.2
|
||||||
192.168.90.2
|
192.168.90.2
|
||||||
192.168.100.2
|
192.168.100.2
|
||||||
|
192.168.201.3
|
||||||
|
|
||||||
[smbclient]
|
[smbclient]
|
||||||
192.168.50.2
|
192.168.50.2
|
||||||
@@ -32,3 +34,6 @@
|
|||||||
|
|
||||||
[public]
|
[public]
|
||||||
192.168.201.2
|
192.168.201.2
|
||||||
|
|
||||||
|
[snmpd]
|
||||||
|
192.168.201.3
|
||||||
|
|||||||
@@ -11,11 +11,12 @@
|
|||||||
- lineinfile:
|
- lineinfile:
|
||||||
path: /etc/snmp/snmpd.conf
|
path: /etc/snmp/snmpd.conf
|
||||||
state: present
|
state: present
|
||||||
|
backrefs: yes
|
||||||
regexp: "{{ item.regexp }}"
|
regexp: "{{ item.regexp }}"
|
||||||
line: "{{ item.line }}"
|
line: "{{ item.line }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { regexp: '[\s+]rocommunity public[\s+]-V[\s+]systemonly', line: ' rocommunity public' }
|
- { 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' }
|
- { regexp: '^agentAddress\s+udp:127.0.0.1:161', line: 'agentAddress udp:161' }
|
||||||
tags: configure_snmpd
|
tags: configure_snmpd
|
||||||
become: true
|
become: true
|
||||||
- name: enable snmpd service and ensure it is not masked
|
- name: enable snmpd service and ensure it is not masked
|
||||||
|
|||||||
Reference in New Issue
Block a user