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_vrouter_interface_ip.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_vrouter_interface_ip
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to add/remove vrouter-interface-ip
description:
  - This module can be used to add an IP address on interface from a vRouter
    or remove an IP address on interface from a vRouter.
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 addvrouter-interface-ip
        and C(absent) to remove vrouter-interface-ip.
    required: true
    type: str
    choices: ['present', 'absent']
  pn_bd:
    description:
      - interface Bridge Domain.
    required: false
    type: str
  pn_netmask:
    description:
      - netmask.
    required: false
    type: str
  pn_vnet:
    description:
      - interface VLAN VNET.
    required: false
    type: str
  pn_ip:
    description:
      - IP address.
    required: false
    type: str
  pn_nic:
    description:
      - virtual NIC assigned to interface.
    required: false
    type: str
  pn_vrouter_name:
    description:
      - name of service config.
    required: false
    type: str
s�
- name: Add vrouter interface to nic
  pn_vrouter_interface_ip:
    state: "present"
    pn_cliswitch: "sw01"
    pn_vrouter_name: "foo-vrouter"
    pn_ip: "2620:0:1651:1::30"
    pn_netmask: "127"
    pn_nic: "eth0.4092"

- name: Remove vrouter interface to nic
  pn_vrouter_interface_ip:
    state: "absent"
    pn_cliswitch: "sw01"
    pn_vrouter_name: "foo-vrouter"
    pn_ip: "2620:0:1651:1::30"
    pn_nic: "eth0.4092"
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the vrouter-interface-ip command.
  returned: always
  type: list
stderr:
  description: set of error responses from the vrouter-interface-ip 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`sE|jd}|jd}|jd}|d}t||�d}|rY|j�}n||krktnt}|r�|d|}|d|7}t||�d}|r�||jd�d	kr�t}	q�t}	n|r8|d|}|d
7}t||�d}|r|j�}n||kr/tnt}
n||	|
fS(s�
    This method checks if vRouter exists on the target node.
    This method also checks for idempotency using the vrouter-interface-show
    command.
    If the given vRouter exists, return VROUTER_EXISTS as True else False.

    If an interface with the given ip exists on the given vRouter,
    return INTERFACE_EXISTS as True else False. This is required for
    vrouter-interface-add.

    If nic_str exists on the given vRouter, return NIC_EXISTS as True else
    False. This is required for vrouter-interface-remove.

    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    :return Booleans: VROUTER_EXISTS, INTERFACE_EXISTS, NIC_EXISTS
    tpn_vrouter_nametpn_iptpn_nics) vrouter-show format name no-show-headersis( vrouter-interface-show vrouter-name %s s%ip2 %s format ip2,nic no-show-headerst i����sformat nic no-show-headers(tparamsRtsplittTruetFalse(tmoduletclitvrouter_nametinterface_iptnic_strt
check_vroutertouttVROUTER_EXISTStshowtINTERFACE_EXISTSt
NIC_EXISTS((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_interface_ip.pyt	check_clios.



		
cC`s%tdddd�}tdtdtdtdd	�d
tdtdd	d|j��dtdtdd	�d
tdtdd	�dtdtdd	�dtdtdd	�dtdtdd	�dtdtdd	��dd
ddddd
ggd
ddddggf�}|jd}|jd
}|jd}|jd
}|jd}|jd}|jd}|jd}	||}
t||�}t||�\}}
}|tkr�|jdtdd|	�n|tkr�|jdtdd|�n|d|
|	f7}|
dkr�|
tkrB|j	dtdd|�n|d||f7}|rm|d|7}n|r�|d|7}n|r�|d|7}q�n|
dkr|
tkr�|j	dtdd|�n|r�|d|7}n|r|d |j
d!�d"7}qnt|||�d#S($s' This section is for arguments parsing tpresentsvrouter-interface-ip-addtabsentsvrouter-interface-ip-removet
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicestpn_bdt
pn_netmasktpn_vnetR
RRtrequired_iftfailedtmsgsvRouter %s does not exists"vRouter with nic %s does not exists %s vrouter-name %s tskippeds"vRouter with interface ip %s exists nic %s ip %s s bd s	 netmask s vnet s+vRouter with interface ip %s does not exists nic %s s ip %s t/iN(tdictRRRtkeysRR	Rt	fail_jsont	exit_jsonRR
(t	state_mapRt	cliswitchR'tbdtnetmasktvnettiptnicRtcommandRRRR((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_interface_ip.pytmain�st	








				!t__main__N(t
__future__RRRR%t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
t.ansible.module_utils.network.netvisor.netvisorRRR=t__name__(((s\/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_interface_ip.pyt<module>s


7	7	V

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