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_vlans.pyc

�
�Udac@`s�dZddlmZmZmZeZidd6dgd6dd6Zd	Zd
Z	dZ
ddlmZdd
l
mZddlmZd�Zedkr�e�ndS(s!
The module file for junos_vlans
i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys�
---
module: junos_vlans
version_added: 2.9
short_description: Create and manage VLAN configurations on Junos OS
description: This module creates and manages VLAN configurations on Junos OS.
author: Daniel Mellado (@danielmellado)
requirements:
  - ncclient (>=v0.6.4)
notes:
  - This module requires the netconf system service be enabled on
    the remote device being managed
  - Tested against Junos OS 18.4R1
  - This module works with connection C(netconf). See L(the Junos OS
    Platform Options,../network/user_guide/platform_junos.html).
options:
  config:
    description: A dictionary of Vlan options
    type: list
    elements: dict
    suboptions:
      vlan_id:
        description:
          - IEEE 802.1q VLAN identifier for VLAN (1..4094).
        type: int
        required: true
      name:
        description:
          - Name of VLAN.
        type: str
        required: true
      description:
        description:
          - Text description of VLANs
        type: str
  state:
    description:
      - The state of the configuration after module completion.
    type: str
    choices:
      - merged
      - replaced
      - overridden
      - deleted
    default: merged
s�
# Using merged
#############

# Before State
# ------------
#
# admin# show vlans
# vlan-2 {
#     vlan-id 2;
# }
# vlan-3 {
#     vlan-id 3;
# }

- name: Merge JUNOS vlan
  junos_vlans:
    config:
      - name: vlan-1
        vlan-id: 1
  state: merged

# After State
# -----------
#
# admin# show vlans
# vlan-1 {
#     vlan-id 1;
# }
# vlan-2 {
#     vlan-id 2;
# }
# vlan-3 {
#     vlan-id 3;
# }


# Using replaced
################

# Before State
# ------------
#
# admin# show vlans
# vlan-1 {
#     vlan-id 1;
# }
# vlan-2 {
#     vlan-id 2;
# }
# vlan-3 {
#     vlan-id 3;
# }

- name: Replace JUNOS vlan
  junos_vlans:
    config:
      - name: vlan-1
        vlan-id: 10
      - name: vlan-3
        vlan-id: 30
  state: replaced

# After State
# -----------
#
# admin# show vlans
# vlan-1 {
#     vlan-id 10;
# }
# vlan-2 {
#     vlan-id 2;
# }
# vlan-3 {
#     vlan-id 30;
# }


# Using overridden
##################

# Before State
# ------------
#
# admin# show vlans
# vlan-1 {
#     vlan-id 1;
# }
# vlan-2 {
#     vlan-id 2;
# }
# vlan-3 {
#     vlan-id 3;
# }

- name: Override JUNOS vlan
  junos_vlans:
    config:
      - name: vlan-4
        vlan-id: 100
      - name: vlan-2
        vlan-id: 200
  state: overridden

# After State
# -----------
#
# admin# show vlans
# vlan-2 {
#     vlan-id 200;
# }
# vlan-4 {
#     vlan-id 100;
# }


#Using deleted
##############

# Before State
# ------------
#
# admin# show vlans
# vlan-1 {
#     vlan-id 1;
# }
# vlan-2 {
#     vlan-id 2;
# }
# vlan-3 {
#     vlan-id 3;
# }

- name: Delete JUNOS vlan
  junos_vlans:
    config:
      - name: vlan-1
  state: deleted

# After State
# -----------
#
# admin# show vlans
# vlan-2 {
#     vlan-id 2;
# }
# vlan-3 {
#     vlan-id 3;
# }
sW
before:
  description: The configuration as structured data prior to module invocation.
  returned: always
  type: str
  sample: >
    The configuration returned will always be in the same format
     of the parameters above.
after:
  description: The configuration as structured data after module completion.
  returned: when changed
  type: str
  sample: >
    The configuration returned will always be in the same format
     of the parameters above.
commands:
  description: The set of commands pushed to the remote device.
  returned: always
  type: list
  sample: ['xml 1', 'xml 2', 'xml 3']
(t
AnsibleModule(t	VlansArgs(tVlanscC`skddd
fdddfdddfg}tdtjd|dt�}t|�j�}|j|�d	S(
s`
    Main entry point for module execution

    :returns: the result form module invocation
    tstatetmergedtconfigtreplacedt
overriddent
argument_spectrequired_iftsupports_check_modeN(sconfig(sconfig(sconfig(RR	RtTrueR
texecute_modulet	exit_json(Rtmoduletresult((sM/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_vlans.pytmains	t__main__N(t__doc__t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt6ansible.module_utils.network.junos.argspec.vlans.vlansR	t5ansible.module_utils.network.junos.config.vlans.vlansR
Rt__name__(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/junos/junos_vlans.pyt<module>s

0�	

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