�
�Udac @` s d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
d d
l j j Z d d l m Z d d l m Z e j � Z y d d
l Z Wn e k
r� e Z n Xd e f d � � YZ d � Z e d k re � n d
S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust certifiedt supported_bys
module: na_elementsw_vlan
short_description: NetApp Element Software Manage VLAN
extends_documentation_fragment:
- netapp.solidfire
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Create, delete, modify VLAN
options:
state:
description:
- Whether the specified vlan should exist or not.
choices: ['present', 'absent']
default: present
vlan_tag:
description:
- Virtual Network Tag
required: true
name:
description:
- User defined name for the new VLAN
- Name of the vlan is unique
- Required for create
svip:
description:
- Storage virtual IP which is unique
- Required for create
address_blocks:
description:
- List of address blocks for the VLAN
- Each address block contains the starting IP address and size for the block
- Required for create
netmask:
description:
- Netmask for the VLAN
- Required for create
gateway:
description:
- Gateway for the VLAN
namespace:
description:
- Enable or disable namespaces
type: bool
attributes:
description:
- Dictionary of attributes with name and value for each attribute
sO
- name: Create vlan
na_elementsw_vlan:
state: present
name: test
vlan_tag: 1
svip: "{{ ip address }}"
netmask: "{{ netmask }}"
address_blocks:
- start: "{{ starting ip_address }}"
size: 5
- start: "{{ starting ip_address }}"
size: 5
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Delete Lun
na_elementsw_vlan:
state: absent
vlan_tag: 1
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
s
( t
AnsibleModule( t to_nativeN( t NetAppModule( t NaElementSWModulet
ElementSWVlanc B` sM e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z RS( s! class to handle VLAN operations c C` s� t j � | _ | j j t d t d t d d d g d d � d t d t d d � d
t d t d d � d t d t d d � d t d t d d � d
t d t d d � d t d t d d � d t d t d d � d t d t d d � � � t d | j d t � | _ t t k r(| j j
d d � n t j d | j � | _ t
� | _ | j j | j j � | _ t | j � | _ | j j d � d k r�| j d j | j j d d � � n | j j d d � | j d <d S( sG
Setup Ansible parameters and ElementSW connection
t statet requiredt choicest presentt absentt defaultt namet typet strt vlan_tagt svipt netmaskt gatewayt namespacet boolt
attributest dictt address_blockst listt
argument_spect supports_check_modet msgs) Unable to import the SolidFire Python SDKt modulet sourcet na_elementsw_vlanN( t netapp_utilst ontap_sf_host_argument_specR t updateR t Falset TrueR R# t
HAS_SF_SDKt fail_jsont create_sf_connectiont elemR
t na_helpert set_parameterst paramst
parametersR t elementsw_helpert gett Nonet set_element_attributes( t self( ( sT /usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_vlan.pyt __init__z s0 &c ` s� d d d d g } t � f d � | D� � t k rN � j j d d | � n d d g } xG � j d D]8 } d | k s� d | k rh � j j d d
| � qh qh Wd S( sO
Validate if all required keys are present before creating
R R R R c 3` s$ | ] } | � j j � k Vq d S( N( R2 t keys( t .0t item( R7 ( sT /usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_vlan.pys <genexpr>� s R"