Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/netvisor/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_snmp_community.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	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(tpn_clitrun_cli(trun_commandscC`sS|jd}|d7}t||�d}|r?|j�}n||krOtStS(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
    tpn_community_strings< snmp-community-show format community-string no-show-headersi(tparamsRtsplittTruetFalse(tmoduletclitcomm_strtout((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_snmp_community.pyt	check_cli]s

c	C`s!tdddddd�}tdtdtd	td
d�dtd	td
dd
|j��dtd	td
dd
ddg�dtd	td
d��dddddggdddggddddggf�}|jd}|jd}|jd}|jd}||}t||�}t||�}|dkrf|tkrf|jdtdd|�qfn|dkr�|tkr�|j	dtdd|�q�n|dkr�|tkr�|j	dtdd|�q�n|d||f7}|dkr
|r
|d|7}nt
|||�dS(s' This section is for arguments parsing tpresentssnmp-community-createtabsentssnmp-community-deletetupdatessnmp-community-modifyt
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicestpn_community_types	read-onlys
read-writeRtrequired_iftfailedtmsgs%snmp community name %s does not existtskippeds*snmp community with name %s already existss %s community-string %s s community-type N(tdictRRRtkeysR
R	Rt	fail_jsont	exit_jsonR
(	t	state_mapRt	cliswitchRtcommunity_typeRtcommandRtCOMMUNITY_EXISTS((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_snmp_community.pytmainosR	




			t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
t.ansible.module_utils.network.netvisor.netvisorRRR.t__name__(((sV/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_snmp_community.pyt<module>s


!		C

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]