Anons79 Mini Shell

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

�
�Udac@`s ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZddlmZmZddlmZmZmZddlmZmZmZmZeZd�Zdd�Zd�Z e!dkre �ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiont
deprecatedtstatustnetworktsupported_bys�	
---
module: junos_l2_interface
version_added: "2.5"
author: "Ganesh Nalawade (@ganeshrn)"
short_description: Manage Layer-2 interface on Juniper JUNOS network devices
description:
  - This module provides declarative management of Layer-2 interface
    on Juniper JUNOS network devices.
deprecated:
  removed_in: "2.13"
  why: Updated modules released with more functionality
  alternative: Use M(junos_l2_interfaces) instead.
options:
  name:
    description:
      - Name of the interface excluding any logical unit number.
  description:
    description:
      - Description of Interface.
  aggregate:
    description:
      - List of Layer-2 interface definitions.
  mode:
    description:
      - Mode in which interface needs to be configured.
    choices: ['access', 'trunk']
  access_vlan:
    description:
      - Configure given VLAN in access port. The value of C(access_vlan) should
        be vlan name.
  trunk_vlans:
    description:
      - List of VLAN names to be configured in trunk port. The value of C(trunk_vlans) should
        be list of vlan names.
  native_vlan:
    description:
      - Native VLAN to be configured in trunk port. The value of C(native_vlan)
        should be vlan id.
  enhanced_layer:
    description:
      - True if your device has Enhanced Layer 2 Software (ELS).
    default: True
    type: bool
    version_added: "2.7"
  unit:
    description:
      - Logical interface number. Value of C(unit) should be of type
        integer.
    default: 0
  filter_input:
    description:
      - The name of input filter of ethernet-switching.
    version_added: "2.8"
  filter_output:
    description:
      - The name of output filter of ethernet-switching.
    version_added: "2.8"
  state:
    description:
      - State of the Layer-2 Interface configuration.
    default: present
    choices: ['present', 'absent',]
  active:
    description:
      - Specifies whether or not the configuration is active or deactivated
    default: True
    type: bool
requirements:
  - ncclient (>=v0.5.2)
notes:
  - This module requires the netconf system service be enabled on
    the remote device being managed.
  - Tested against vqfx-10000 JUNOS Version 15.1X53-D60.4.
  - Recommended connection is C(netconf). See L(the Junos OS Platform Options,../network/user_guide/platform_junos.html).
  - This module also works with C(local) connections for legacy playbooks.
extends_documentation_fragment: junos
s2
- name: Configure interface in access mode
  junos_l2_interface:
    name: ge-0/0/1
    description: interface-access
    mode: access
    access_vlan: red
    active: True
    state: present

- name: Configure interface in trunk mode
  junos_l2_interface:
    name: ge-0/0/1
    description: interface-trunk
    mode: trunk
    trunk_vlans:
    - blue
    - green
    native_vlan: 100
    active: True
    state: present

- name: Configure interface in access and trunk mode using aggregate
  junos_l2_interface:
    aggregate:
    - name: ge-0/0/1
      description: test-interface-access
      mode: access
      access_vlan: red
    - name: ge-0/0/2
      description: test-interface-trunk
      mode: trunk
      trunk_vlans:
      - blue
      - green
      native_vlan: 100
    active: True
    state: present
s2
diff:
  description: Configuration difference before and after applying change.
  returned: when configuration is changed and diff option is enabled.
  type: str
  sample: >
        [edit interfaces]
        +   ge-0/0/1 {
        +       description "l2 interface configured by Ansible";
        +       unit 0 {
        +           family ethernet-switching {
        +               interface-mode access;
        +               vlan {
        +                   members red;
        +               }
        +           }
        +       }
        +   }
N(tdeepcopy(t
AnsibleModule(tremove_default_spec(tjunos_argument_specttostring(tload_configtmap_params_to_objtmap_obj_to_ele(tcommit_configurationtdiscard_changest
locked_configt
to_param_listcC`s:|r6d|kodknr6|jdd�ndS(Nii�tmsgs"vlan_id must be between 1 and 4094(t	fail_json(tvaluetmodule((sU/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_l2_interface.pytvalidate_vlan_id�s#cC`sb|s|j}nxI|D]A}t�jd|�}t|�r||j|�|�qqWdS(Nsvalidate_%s(tparamstglobalstgettcallable(Rtobjtparamtkeyt	validator((sU/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_l2_interface.pytvalidate_param_values�s
cC`s/tdt�dtdddg�dt�dtdd	�d
tdd�dtd
ddd	�dt�dt�dt�dtd
tdd�dtd
ddddg�dtd
tdd��}t|�}tdt�|d<t|�ddgg}ddgdd
gddgg}ddd7fddd8fg}tdtddddd|d|d|��}|j|�|jt�td|d td|d!|d|�}t�}itd"6}|r�||d#<nd$}	t	j
�}
|
jdidd%6td&6fdidd%6dd'6td&6fdid(d%6d)d'6fdid*d%6d+d'6fd
id*d%6d+d'6fdid,d%6d-d'6fdid.d%6d-d'6fdid/d%6fd9g	�t|�}t�}x�|D]�}
x7|
D]/}|
j|�d6kr�|j||
|<q�q�W|
j�}t||
d0|�|
dr9d(nd1|
dd%<t||
d0|�}|jt|||	d0|��q�Wd6}t|���x,|D]$}t|t|�|d2d3�}q�W|j}|r|r�t|�n
t|�t|d"<|jri|d46|d5<qnWd6QX|j|�d6S(:s+ main entry point for module execution
    tnametmodetchoicestaccessttrunktaccess_vlantnative_vlanttypetintttrunk_vlanstlisttunittdefaultitfilter_inputt
filter_outputtdescriptiontenhanced_layertbooltstatetpresenttabsenttactivetrequiredt	aggregatetelementstdicttoptionstmutually_exclusivetrequired_ift
argument_spectsupports_check_modetrequired_one_oftchangedtwarningssinterfaces/interfacetxpathtis_keyttopsinterface-modesunit/family/ethernet-switchingtmemberss#unit/family/ethernet-switching/vlantinputs%unit/family/ethernet-switching/filtertoutputsnative-vlan-idRs	port-modetactiontreplacetpreparedtdiffN(R'(R+(R1R1(R;tTrueRR
tupdateRR	R,tFalsetcollectionstOrderedDictRRtNoneRtcopyR!RtappendRRR
Rt
check_modeRRt_difft	exit_json(telement_spectaggregate_specRAR=R>R?RRCtresultRFtparam_to_xpath_mapRtrequestsRRtitemtwantRMtreqtcommit((sU/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_l2_interface.pytmain�s�					
		*

		


	

#

"



	t__main__("t
__future__RRRR)t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRQRTRtansible.module_utils.basicR	t)ansible.module_utils.network.common.utilsR
t(ansible.module_utils.network.junos.junosRRR
RRRRRRRNtUSE_PERSISTENT_CONNECTIONRRSR!Rbt__name__(((sU/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_l2_interface.pyt<module>s(


P("	
	h

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