Настраиваем SNMP v3 для устройства MikroTik с помощью Ansible.
---
- hosts: test_device
connection: network_cli
gather_facts: false
tasks:
- name: Collect hardware facts from the MikroTik device
community.routeros.facts:
gather_subset:
- hardware
register: hardware_facts
- name: Add and Enable SNMP Community
community.routeros.command:
commands:
- /snmp community add addresses=::/0 authentication-password=MyPassw01 authentication-protocol=SHA1 encryption-password=MyPassw02 encryption-protocol=AES name=SNMPCOM security=private
- name: Add and Enable SNMP
community.routeros.command:
commands:
- /snmp set contact="Yun Sergey" enabled=yes engine-id-suffix={{ hardware_facts.ansible_facts.ansible_net_serialnum }} location=MyLocation trap-community=SNMPCOM trap-interfaces=all trap-version=3
Добавить комментарий