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_role.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZmZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys3
---
module: pn_role
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/delete/modify role
description:
  - This module can be used to create, delete and modify user roles.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    required: false
    type: str
  state:
    description:
      - State the action to perform. Use C(present) to create role and
        C(absent) to delete role and C(update) to modify role.
    required: true
    type: str
    choices: ['present', 'absent', 'update']
  pn_scope:
    description:
      - local or fabric.
    required: false
    type: str
    choices: ['local', 'fabric']
  pn_access:
    description:
      - type of access.
    required: false
    type: str
    choices: ['read-only', 'read-write']
  pn_shell:
    description:
      - allow shell command.
    required: false
    type: bool
  pn_sudo:
    description:
      - allow sudo from shell.
    required: false
    type: bool
  pn_running_config:
    description:
      - display running configuration of switch.
    required: false
    type: bool
  pn_name:
    description:
      - role name.
    required: true
    type: str
  pn_delete_from_users:
    description:
      - delete from users.
    required: false
    type: bool
s�
- name: Role create
  pn_role:
    pn_cliswitch: 'sw01'
    state: 'present'
    pn_name: 'foo'
    pn_scope: 'local'
    pn_access: 'read-only'

- name: Role delete
  pn_role:
    pn_cliswitch: 'sw01'
    state: 'absent'
    pn_name: 'foo'

- name: Role modify
  pn_role:
    pn_cliswitch: 'sw01'
    state: 'update'
    pn_name: 'foo'
    pn_access: 'read-write'
    pn_sudo: true
    pn_shell: true
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the role command.
  returned: always
  type: list
stderr:
  description: set of error responses from the role 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`sS|jd}|d7}t||�d}|r?|j�}n||krOtStS(s�
    This method checks for idempotency using the role-show command.
    If a role with given name exists, return True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_names& role-show format name no-show-headersi(tparamsRtsplittTruetFalse(tmoduletclit	role_nametout((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_role.pyt	check_cli|s

cC`s�tdddddd�}tdtdtd	td
d�dtd	td
dd
|j��dtd	td
dd
ddg�dtd	td
dd
ddg�dtd	td
d�dtd	td
d�dtd	td
d�dtd	td
d�dtd	td
d��	dddddggdddggdddggf�}|jd}|jd}|jd}|jd}|jd}|jd}|jd}|jd}	|jd}
||}t||�}t||�}
|d||	f7}|tpdkr,|tkr,|jdtdd�n|dkrd|
tkrd|jdtdd |	�qdn|dkr�|
tkr�|j	d!tdd |	�q�n|dkr�|
tkr�|j	d!tdd"|	�n|r�|d#|7}q�n|dkrS|r|d$|7}n|t
|d%d&�7}|t
|d'd(�7}|t
|d)d*�7}n|dkry|
ry|d+|
7}qynt|||�d,S(-s' This section is for arguments parsing tpresentsrole-createtabsentsrole-deletetupdatesrole-modifyt
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicestpn_scopetlocaltfabrict	pn_accesss	read-onlys
read-writetpn_shelltbooltpn_sudotpn_running_configR
tpn_delete_from_userstrequired_ifs %s name %s ttfailedtmsgs!sudo access requires shell accesss Role with name %s does not existtskippeds Role with name %s already existss scope s access tshellsno-shelltsudosno-sudosrunning-configsno-running-configs delete-from-users N(tdictRRRtkeysRR	Rt	fail_jsont	exit_jsonRR
(t	state_mapRt	cliswitchRtscopetaccessR/R0trunning_configtnametdelete_from_userstcommandRtROLE_EXISTS((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_role.pytmain�s�	









	
			t__main__N(t
__future__RRRRt
__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__(((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_role.pyt<module>s


=		_

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