community.network.pn_snmp_community (5.0.2) — module

CLI command to create/modify/delete snmp-community

Authors: Pluribus Networks (@rajaspachipulusu17)

Install collection

Install with ansible-galaxy collection install community.network:==5.0.2


Add to requirements.yml

  collections:
    - name: community.network
      version: 5.0.2

Description

This module can be used to create SNMP communities for SNMPv1 or delete SNMP communities for SNMPv1 or modify SNMP communities for SNMPv1.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create snmp community
  community.network.pn_snmp_community:
    pn_cliswitch: "sw01"
    state: "present"
    pn_community_string: "foo"
    pn_community_type: "read-write"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete snmp community
  community.network.pn_snmp_community:
    pn_cliswitch: "sw01"
    state: "absent"
    pn_community_string: "foo"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Modify snmp community
  community.network.pn_snmp_community:
    pn_cliswitch: "sw01"
    state: "update"
    pn_community_string: "foo"
    pn_community_type: "read-only"

Inputs

    
state:
    choices:
    - present
    - absent
    - update
    description:
    - State the action to perform. Use C(present) to create snmp-community and C(absent)
      to delete snmp-community C(update) to update snmp-community.
    required: true
    type: str

pn_cliswitch:
    description:
    - Target switch to run the CLI on.
    required: false

pn_community_type:
    choices:
    - read-only
    - read-write
    description:
    - community type.
    type: str

pn_community_string:
    description:
    - community name.
    type: str

Outputs

changed:
  description: indicates whether the CLI caused changes on the target.
  returned: always
  type: bool
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stderr:
  description: set of error responses from the snmp-community command.
  returned: on error
  type: list
stdout:
  description: set of responses from the snmp-community command.
  returned: always
  type: list