�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d d
l m Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys~
---
module: pn_snmp_community
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/modify/delete snmp-community
description:
- This module can be used to create SNMP communities for SNMPv1 or
delete SNMP communities for SNMPv1 or modify SNMP communities for SNMPv1.
options:
pn_cliswitch:
description:
- Target switch to run the CLI on.
required: false
state:
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
choices: ['present', 'absent', 'update']
pn_community_type:
description:
- community type.
type: str
choices: ['read-only', 'read-write']
pn_community_string:
description:
- community name.
type: str
s�
- name: Create snmp community
pn_snmp_community:
pn_cliswitch: "sw01"
state: "present"
pn_community_string: "foo"
pn_community_type: "read-write"
- name: Delete snmp community
pn_snmp_community:
pn_cliswitch: "sw01"
state: "absent"
pn_community_string: "foo"
- name: Modify snmp community
pn_snmp_community:
pn_cliswitch: "sw01"
state: "update"
pn_community_string: "foo"
pn_community_type: "read-only"
s�
command:
description: the CLI command run on the target node.
returned: always
type: str
stdout:
description: set of responses from the snmp-community command.
returned: always
type: list
stderr:
description: set of error responses from the snmp-community command.
returned: on error
type: list
changed:
description: indicates whether the CLI caused changes on the target.
returned: always
type: bool
( t
AnsibleModule( t pn_clit run_cli( t run_commandsc C` sS | j d } | d 7} t | | � d } | r? | j � } n | | k rO t St S( s�
This method checks for idempotency using the snmp-community-show command.
If a user with given name exists, return as True else False.
:param module: The Ansible module to fetch input parameters
:param cli: The CLI string
t pn_community_strings<