Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/netapp/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlj
jZej�Zd
efd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys
module: na_ontap_net_vlan
short_description: NetApp ONTAP network VLAN
extends_documentation_fragment:
    - netapp.na_ontap
version_added: '2.6'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Create or Delete a network VLAN
options:
  state:
    description:
    - Whether the specified network VLAN should exist or not
    choices: ['present', 'absent']
    default: present
  parent_interface:
    description:
    - The interface that hosts the VLAN interface.
    required: true
  vlanid:
    description:
    - The VLAN id. Ranges from 1 to 4094.
    required: true
  node:
    description:
    - Node name of VLAN interface.
    required: true
notes:
  - The C(interface_name) option has been removed and should be deleted from playbooks
s7
    - name: create VLAN
      na_ontap_net_vlan:
        state: present
        vlanid: 13
        node: "{{ vlan node }}"
        parent_interface: "{{ vlan parent interface name }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
        hostname: "{{ netapp_hostname }}"
s

(t
AnsibleModuleNtNetAppOntapVlancB`sDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(s+
    Created, and destorys Net Vlans's
    cC`s?tj�|_|jjtdtdtdddgdd�dtdtdd	�d
tdtdd	�dtdtdd	���td|jd
t�|_|jj	}|d|_
|d|_|d
|_|d|_
t|d�dt|j�|_ttkr#|jjdd�ntjd|j�|_dS(s:
        Initializes the NetAppOntapVlan function
        tstatetrequiredtchoicestpresenttabsenttdefaulttparent_interfacettypetstrtvlanidtnodet
argument_spectsupports_check_modet-tmsgs(the python NetApp-Lib module is requiredtmoduleN(tnetapp_utilstna_ontap_host_argument_specRtupdatetdicttFalsetTrueRRtparamsR
RRRRtinterface_nametHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tselftp((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pyt__init__Fs&!	



$cC`sBtjjd�}|j�}|j|�|jj|t�dS(s$
        Creates a new vlan
        snet-vlan-createN(Rtzapit	NaElementtcreate_vlan_infotadd_child_elemR%tinvoke_successfullyR(R&tvlan_objt	vlan_info((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pytcreate_vlanes
cC`sBtjjd�}|j�}|j|�|jj|t�dS(s!
        Deletes a vland
        snet-vlan-deleteN(RR)R*R+R,R%R-R(R&R.R/((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pytdelete_vlanos
cC`s�tjjd�}|jd|j�|jd|j�y8|jj|t�}|j	d�j	d�j	d�Wntjj
k
r�tSXtS(s�
        Checks to see if a vlan already exists or not
        :return: Returns True if the vlan exists, false if it doesn't
        snet-vlan-getsinterface-nameRt
attributess	vlan-info(RR)R*t
add_new_childR!RR%R-Rtget_child_by_namet
NaApiErrorR(R&R.tresult((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pytdoes_vlan_existys#cC`sOtjjd�}|jd|j�|jd|j�|jd|j�|S(sZ
        Create a vlan_info object to be used in a create/delete
        :return:
        s	vlan-infosparent-interfaceRR(RR)R*R3RRR(R&R/((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pyR+�s
cC`s�t}d}tj|j�}tjd|jd|�}tjd|�|j�}|rv|j	dkr�t
}q�n|j	dkr�t
}n|r�|jjr�q�|j	dkr�|j�q�|j	dkr�|j
�q�n|jjd|d|�dS(	s`
        check the option in the playbook to see what needs to be done
        :return:
        Rtvservertna_ontap_net_vlanRR
tchangedtmetaN(RtNoneRtget_cserverR%R$Rt
ems_log_eventR7R
Rt
check_modeR0R1t	exit_json(R&R:R6tresultstcservert
existing_vlan((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pytapply�s&	
(	t__name__t
__module__t__doc__R(R0R1R7R+RD(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pyR	Bs		
	
		
cC`st�}|j�dS(sO
    Creates the NetApp Ontap vlan object, and runs the correct play task.
    N(R	RD(tv((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pytmain�s	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.netapptmodule_utilstnetappRthas_netapp_libR"tobjectR	RIRE(((sT/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_net_vlan.pyt<module>s


o	

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