Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/onyx/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddl
mZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: onyx_mlag_ipl
version_added: "2.5"
author: "Samer Deeb (@samerd)"
short_description: Manage IPL (inter-peer link) on Mellanox ONYX network devices
description:
  - This module provides declarative management of IPL (inter-peer link)
    management on Mellanox ONYX network devices.
notes:
  - Tested on ONYX 3.6.4000
options:
  name:
    description:
      - Name of the interface (port-channel) IPL should be configured on.
    required: true
  vlan_interface:
    description:
      - Name of the IPL vlan interface.
  state:
    description:
      - IPL state.
    default: present
    choices: ['present', 'absent']
  peer_address:
    description:
      - IPL peer IP address.
s�
- name: run configure ipl
  onyx_mlag_ipl:
    name: Po1
    vlan_interface: Vlan 322
    state: present
    peer_address: 192.168.7.1

- name: run remove ipl
  onyx_mlag_ipl:
    name: Po1
    state: absent
s�
commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  type: list
  sample:
    - interface port-channel 1 ipl 1
    - interface vlan 1024 ipl 1 peer-address 10.10.10.10
N(t
AnsibleModule(tBaseOnyxModule(tshow_cmdtOnyxMlagIplModulecB`s�eZejd�Zed��Zd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�ZRS(
s	^Vlan \d+c
C`sCtdtdt�dtdddddg�dt�d	t��S(
Ntnametrequiredtstatetdefaulttpresenttchoicestabsenttpeer_addresstvlan_interface(tdicttTrue(tcls((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_get_element_specLs	cC`s>|j�}t�}|j|�td|dt�|_dS(s module initialization
        t
argument_spectsupports_check_modeN(RRtupdateRRt_module(tselftelement_specR((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pytinit_moduleVs	
c
C`sT|jj}td|dd|dd|dd|d�|_|j|j�dS(NRRRR(RtparamsRt_required_configtvalidate_param_values(Rt
module_params((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pytget_required_config`s


c
C`s�|s
dS|jdi�}d}|j|�}|r�|d}|jd�}d}|dkrod|}n|jd�}|jd	�}	td
|	d|d|�|_ndS(
NsMLAG IPLs Summaryt1isVlan InterfacetsN/AsVlan %ssPeer IP addresssGroup Port-ChannelRRR(tgetRt_current_config(
Rt	mlag_datatmlag_summarytipl_idtipl_listtipl_datatvlan_idRRR((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_update_mlag_datais"

cC`s"d}t|j|dtdt�S(Ns	show mlagtjson_fmtt
fail_on_error(R
RRtFalse(Rtcmd((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_show_mlag_data|scC`s)t�|_|j�}|j|�dS(N(RR(R4R/(RR)((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pytload_current_config�scC`s:|jd�r|jdd�S|jjdd|�dS(NtPos
port-channel tmsgsinvalid interface name: %s(t
startswithtreplaceRt	fail_json(Rtif_name((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_get_interface_cmd_name�scC`s8|j|�}|rd}nd}d||f}|S(Nsipl 1sno ipl 1sinterface %s %s(R<(RR;tenabletif_cmd_nametipl_cmdR3((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_generate_port_channel_command�s	cC`s9|j�}|rd|}nd}d||f}|S(Nsipl 1 peer-address %ssno ipl 1sinterface %s %s(tlower(RR;R=RR>R?R3((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_generate_vlan_if_command�s
cC`s\|jjd�}|jjd�}||krX|j|dt�}|jj|�ndS(NRR=(R(R'R!R@R2t	_commandstappend(Rtcurr_interfacet
req_interfaceR3((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_generate_no_ipl_commands�sc	C`s||jjd�}|jjd�}||kr�|rj|dkrj|j|dt�}|jj|�n|j|dt�}|jj|�n|jjd�}|jjd�}t}||krt}|r|j|dtdd�}|jj|�qn|jjd�}|jjd�}||kr>t}n|rx|rx|j|dtd|�}|jj|�ndS(NRsN/AR=RR(
R(R'R!R@R2RCRDRRBtNone(	RRERFR3t	curr_vlantreq_vlantadd_peert	curr_peertreq_peer((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt_generate_ipl_commands�s6			cC`s4|jd}|dkr&|j�n
|j�dS(NRR(R!RGRN(RR((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pytgenerate_commands�s

(t__name__t
__module__tretcompilet
VLAN_IF_REGEXtclassmethodRRR$R/R4R5R<R@RBRGRNRO(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyRIs
	
												cC`stj�dS(s+ main entry point for module execution
    N(Rtmain(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyRV�st__main__(t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRRtansible.module_utils.basicRt&ansible.module_utils.network.onyx.onyxR	R
RRVRP(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_mlag_ipl.pyt<module>s



�	

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