Bookmark this page

Enabling SNMP

Objectives

After completing this section, you be able to enable SNMP management and configure a read-only community with Ansible.

Enabling SNMP

Ansible makes it easy to manage configuration of SNMP settings, including the community string and access restrictions.

The following task configures the community string for read-only access on an IOS device:

- name: set the RO community string
  ios_config:
    lines:
      - snmp-server community {{ ro_community }} RO

A similar configuration statement for VyOS is shown below:

- name: set the RO community string
  vyos_config:
    lines:
      - set service snmp community {{ ro_community }} authorization ro
Revision: do457-2.5-4693601