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_vacm.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZmZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
module: pn_snmp_vacm
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/modify/delete snmp-vacm
description:
  - This module can be used to create View Access Control Models (VACM),
    modify VACM and delete VACM.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    type: str
    required: false
  state:
    description:
      - State the action to perform. Use C(present) to create snmp-vacm and
        C(absent) to delete snmp-vacm and C(update) to modify snmp-vacm.
    type: str
    required: true
    choices: ['present', 'absent', 'update']
  pn_oid_restrict:
    description:
      - restrict OID.
    type: str
  pn_priv:
    description:
      - privileges.
    type: bool
  pn_auth:
    description:
      - authentication required.
    type: bool
  pn_user_type:
    description:
      - SNMP user type.
    type: str
    choices: ['rouser', 'rwuser']
  pn_user_name:
    description:
      - SNMP administrator name.
    type: str
s�
- name: create snmp vacm
  pn_snmp_vacm:
    pn_cliswitch: "sw01"
    state: "present"
    pn_user_name: "foo"
    pn_user_type: "rouser"

- name: update snmp vacm
  pn_snmp_vacm:
    pn_cliswitch: "sw01"
    state: "update"
    pn_user_name: "foo"
    pn_user_type: "rwuser"

- name: delete snmp vacm
  pn_snmp_vacm:
    pn_cliswitch: "sw01"
    state: "absent"
    pn_user_name: "foo"
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the snmp-vacm command.
  returned: always
  type: list
stderr:
  description: set of error responses from the snmp-vacm 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_clitbooleanArgs(trun_commandscC`s�|jd}|}|d7}t||�\}}}|rP||j�krPndS|}|d7}t||�d}|r�|j�}n||kr�tStS(s�
    This method checks for idempotency using the snmp-vacm-show command.
    If a user with given name exists, return True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_user_names0 snmp-user-show format user-name no-show-headerss0 snmp-vacm-show format user-name no-show-headersiN(tparamsRtsplittNonetTruetFalse(tmoduletclit	user_nametshowtrctoutterr((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_snmp_vacm.pyt	check_clijs


cC`sBtdddddd�}tdtdtd	td
d�dtd	td
dd
|j��dtd	td
d�dtd	td
d�dtd	td
d�dtd	td
dd
ddg�dtd	td
d��ddddggdddggdddggf�}|jd}|jd}|jd}|jd}|jd}|jd}|jd}||}	t||�}
t||
�}|
d|	|f7}
|	dkr|d%kr�|j	dtdd|�n|tkr|j	dtdd|�qn|	dkrd|d%kr8|j	dtdd|�n|tkrd|j
dtdd|�qdn|	dkr�|d%kr�|j	dtdd|�n|tkr�|j
dtdd|�q�n|	dkr.|r�|
d|7}
n|r�|
d |7}
n|
t|d!d"�7}
|
t|d#d$�7}
nt||
|�d%S(&s' This section is for arguments parsing tpresentssnmp-vacm-createtabsentssnmp-vacm-deletetupdatessnmp-vacm-modifyt
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicestpn_oid_restricttpn_privtbooltpn_authtpn_user_typetrousertrwuserR
trequired_ifs %s user-name %s tfailedtmsgs&snmp user with name %s does not existss&snmp vacm with name %s does not existstskippeds%snmp vacm with name %s does not exists%snmp vacm with name %s already existss oid-restrict s user-type tauthsno-authtprivsno-privN(
tdictRRRtkeysRR	RRt	fail_jsont	exit_jsonRR
(t	state_mapRt	cliswitchR#toid_restrictR1R0t	user_typeRtcommandRtUSER_EXISTS((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_snmp_vacm.pytmain�s�	







						t__main__N(t
__future__RRRR!t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
Rt.ansible.module_utils.network.netvisor.netvisorRRR<t__name__(((sQ/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_snmp_vacm.pyt<module>s


.		_

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