21 lines
774 B
YAML
21 lines
774 B
YAML
- name: Configure snmpd
|
|
hosts: all
|
|
tasks:
|
|
- name: Apt Update
|
|
ansible.builtin.apt:
|
|
update_cache: yes
|
|
|
|
- name: Deploy snmpd
|
|
ansible.builtin.apt:
|
|
name: snmpd
|
|
|
|
- name: Get osupdate script
|
|
ansible.builtin.copy:
|
|
src: /data/projects/utils/osupdate
|
|
dest: /etc/snmp/
|
|
|
|
- name: Configure snmpd
|
|
shell : echo "agentAddress udp:161,udp6:[::1]:161\nrocommunity public default -V systemonly\nrwcommunity manage 192.168.1.30\nrwcommunity manage localhost\nrocommunity6 public default -V systemonly\nsysLocation SDA Corporation/Internet Server/\nsysContact thedarty@gmail.com\nextend osupdate /etc/snmp/osupdate" > /etc/snmp/snmpd.conf
|
|
|
|
- name: Restart snmpd.service
|
|
shell : systemctl restart snmpd.service |