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_vtep.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_bysP
---
module: pn_vtep
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.9"
short_description: CLI command to create/delete vtep
description:
  - This module can be used to create a vtep and delete a vtep.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    required: false
    type: str
  state:
    description:
      - vtep configuration command.
    required: false
    choices: ['present', 'absent']
    type: str
    default: 'present'
  pn_name:
    description:
      - vtep name.
    required: false
    type: str
  pn_ip:
    description:
      - Primary IP address.
    required: false
    type: str
  pn_vrouter_name:
    description:
      - name of the vrouter service.
    required: false
    type: str
  pn_virtual_ip:
    description:
      - Virtual/Secondary IP address.
    required: false
    type: str
  pn_location:
    description:
      - switch name.
    required: false
    type: str
  pn_switch_in_cluster:
    description:
      - Tells whether switch in cluster or not.
    required: false
    type: bool
    default: True
s
- name: create vtep
  pn_vtep:
    pn_cliswitch: 'sw01'
    pn_name: 'foo'
    pn_vrouter_name: 'foo-vrouter'
    pn_ip: '22.22.22.2'
    pn_location: 'sw01'
    pn_virtual_ip: "22.22.22.1"

- name: delete vtep
  pn_vtep:
    pn_cliswitch: 'sw01'
    state: 'absent'
    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 vtep command.
  returned: always
  type: list
stderr:
  description: set of error responses from the vtep 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 vtep-show command.
    If a name exists, return True if name exists else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_names& vtep-show format name no-show-headersi(tparamsRtsplittTruetFalse(tmoduletclitnametout((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vtep.pyt	check_clims

cC`s�tdddd�}tdtdtdd�d	tdtddd
|j�dd�dtdtdd�d
tdtdd�dtdtdd�dtdtdd�dtdtdd�dtdtdddd��}td|dd	ddd
ddggd	ddggf�}|jd}|jd	}|jd}|jd
}|jd}|jd}|jd}	|jd}
|
r�|r�|dkr�|jdtdd�n||}t||�}t||�}
|d||f7}|dkr(|
tkr(|jdtdd|�q(n|dkr�|
tkr]|jdtdd|�n|d|7}|d|7}|d|	7}|r�|d |7}q�nt	|||�d!S("s' This section is for arguments parsing tpresentsvtep-createtabsentsvtep-deletetpn_cliswitchtrequiredttypetstrtstatetchoicestdefaultRtpn_iptpn_vrouter_namet
pn_virtual_iptpn_locationtpn_switch_in_clustertboolRt
argument_spectrequired_iftfailedtmsgs0virtual ip is required when switch is in clusters %s name %s tskippeds vtep with name %s does not exists vtpe with name %s already existssvrouter-name %s sip %s slocation %s svirtual-ip %s N(
tdictRtkeysRR
t	exit_jsonRR	RR
(t	state_mapR%Rt	cliswitchRRtiptvrouter_namet
virtual_iptlocationtswitch_in_clustertcommandRtNAME_EXISTS((sL/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vtep.pytmains`	'







	

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


7		L

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