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_user.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_user
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/modify/delete user
description:
  - This module can be used to create a user and apply a role,
    update a user and delete a user.
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 user and
        C(absent) to delete user C(update) to update user.
    type: str
    required: true
    choices: ['present', 'absent', 'update']
  pn_scope:
    description:
      - local or fabric.
    type: str
    choices: ['local', 'fabric']
  pn_initial_role:
    description:
      - initial role for user.
    type: str
  pn_password:
    description:
      - plain text password.
    type: str
  pn_name:
    description:
      - username.
    type: str
sn
- name: Create user
  pn_user:
    pn_cliswitch: "sw01"
    state: "present"
    pn_scope: "fabric"
    pn_password: "foo123"
    pn_name: "foo"

- name: Delete user
  pn_user:
    pn_cliswitch: "sw01"
    state: "absent"
    pn_name: "foo"

- name: Modify user
  pn_user:
    pn_cliswitch: "sw01"
    state: "update"
    pn_password: "test1234"
    pn_name: "foo"
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the user command.
  returned: always
  type: list
stderr:
  description: set of error responses from the user 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`sJ|jd}|d7}t||�d}|j�}||krFtStS(s�
    This method checks for idempotency using the user-show command.
    If a user already exists on the given switch, return True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_names& user-show format name no-show-headersi(tparamsRtsplittTruetFalse(tmoduletclitnametout((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_user.pyt	check_clifs


cC`s�tdddddd�}tdtdtd	td
d�dtd	td
dd
|j��dtd	td
dd
ddg�dtd	td
d�dtd	td
ddt�dtd	td
d��dddddggdddggddddggf�}|jd}|jd}|jd}|jd}|jd}|jd}||}t||�}	t||	�}
|	d||f7}	|dkr�|
tkr�|jdtdd|�n|s�|r�|jdtdd�q�n|dkr!|
tkr!|j	dtdd|�q!n|dkr�|
tkrV|j	dtdd|�n|rm|	d|7}	n|r�|	d|7}	q�n|dkr�|r�|	d |7}	q�nt
||	|�d!S("s' This section is for arguments parsing tpresentsuser-createtabsentsuser-deletetupdatesuser-modifyt
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicestpn_scopetlocaltfabrictpn_initial_roletpn_passwordtno_logRtrequired_ifs %s name %s tfailedtmsgs User with name %s does not existsOnly password can be modifiedtskippeds user with name %s does not exists User with name %s already existss scope s initial-role s
 password N(tdictRRRtkeysR
R	Rt	fail_jsont	exit_jsonR
(t	state_mapRt	cliswitchRtscopetinitial_roletpasswordRtcommandRtUSER_EXISTS((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_user.pytmainwsl	






		
		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.netvisorRRR5t__name__(((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_user.pyt<module>s


*		Q

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