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

�
�Udac@`sdZddlmZmZmZeZidd6dgd6dd6Zd	Zd
Z	dZ
ddlZdd
lm
Z
ddlmZddljjZej�Zy ddlmZmZeZWnek
r�eZnXdefd��YZd�Zedkre�ndS(sJ
Element Software Node Network Interfaces - Bond 1G and 10G configuration
i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys4


module: na_elementsw_network_interfaces

short_description: NetApp Element Software Configure Node Network Interfaces
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Configure Element SW Node Network Interfaces for Bond 1G and 10G IP address.

options:
    method:
        description:
        - Type of Method used to configure the interface.
        - method depends on other settings such as the use of a static IP address, which will change the method to static.
        - loopback - Used to define the IPv4 loopback interface.
        - manual - Used to define interfaces for which no configuration is done by default.
        - dhcp - May be used to obtain an IP address via DHCP.
        - static - Used to define Ethernet interfaces with statically allocated IPv4 addresses.
        choices: ['loopback', 'manual', 'dhcp', 'static']
        required: true

    ip_address_1g:
        description:
        - IP address for the 1G network.
        required: true

    ip_address_10g:
        description:
        - IP address for the 10G network.
        required: true

    subnet_1g:
        description:
        - 1GbE Subnet Mask.
        required: true

    subnet_10g:
        description:
        - 10GbE Subnet Mask.
        required: true

    gateway_address_1g:
        description:
        - Router network address to send packets out of the local network.
        required: true

    gateway_address_10g:
        description:
        - Router network address to send packets out of the local network.
        required: true

    mtu_1g:
        description:
        - Maximum Transmission Unit for 1GbE, Largest packet size that a network protocol can transmit.
        - Must be greater than or equal to 1500 bytes.
        default: '1500'

    mtu_10g:
        description:
        - Maximum Transmission Unit for 10GbE, Largest packet size that a network protocol can transmit.
        - Must be greater than or equal to 1500 bytes.
        default: '1500'

    dns_nameservers:
        description:
        - List of addresses for domain name servers.

    dns_search_domains:
        description:
        - List of DNS search domains.

    bond_mode_1g:
        description:
        - Bond mode for 1GbE configuration.
        choices: ['ActivePassive', 'ALB', 'LACP']
        default: 'ActivePassive'

    bond_mode_10g:
        description:
        - Bond mode for 10GbE configuration.
        choices: ['ActivePassive', 'ALB', 'LACP']
        default: 'ActivePassive'

    lacp_1g:
        description:
        - Link Aggregation Control Protocol useful only if LACP is selected as the Bond Mode.
        - Slow - Packets are transmitted at 30 second intervals.
        - Fast - Packets are transmitted in 1 second intervals.
        choices: ['Fast', 'Slow']
        default: 'Slow'

    lacp_10g:
        description:
        - Link Aggregation Control Protocol useful only if LACP is selected as the Bond Mode.
        - Slow - Packets are transmitted at 30 second intervals.
        - Fast - Packets are transmitted in 1 second intervals.
        choices: ['Fast', 'Slow']
        default: 'Slow'

    virtual_network_tag:
        description:
        - This is the primary network tag. All nodes in a cluster have the same VLAN tag.

s�

  - name: Set Node network interfaces configuration for Bond 1G and 10G properties
    tags:
    - elementsw_network_interfaces
    na_elementsw_network_interfaces:
      hostname: "{{ elementsw_hostname }}"
      username: "{{ elementsw_username }}"
      password: "{{ elementsw_password }}"
      method: static
      ip_address_1g: 10.226.109.68
      ip_address_10g: 10.226.201.72
      subnet_1g: 255.255.255.0
      subnet_10g: 255.255.255.0
      gateway_address_1g: 10.193.139.1
      gateway_address_10g: 10.193.140.1
      mtu_1g: 1500
      mtu_10g: 9000
      bond_mode_1g: ActivePassive
      bond_mode_10g: LACP
      lacp_10g: Fast
sM

msg:
    description: Success message
    returned: success
    type: str

N(t
AnsibleModule(t	to_native(tNetworkt
NetworkConfigtElementSWNetworkInterfacescB`s2eZdZd�Zd�Zd�Zd�ZRS(sU
    Element Software Network Interfaces - Bond 1G and 10G Network configuration
    c&C`s�tj�|_|jjdtdddtddddd	g�d
tdddt�dtdddt�dtdddt�d
tdddt�dtdddt�dtdddt�dtdddd�dtdddd�dtdd�dtdd�dtddddddddg�dtddddddddg�dtdddddddg�dtdddddddg�d tdd��td!|jd"t�|_|jj}|d|_	|d
|_
|d|_|d|_|d
|_
|d|_|d|_|d|_|d|_|d|_|d|_|d|_|d|_|d|_|d|_|d |_ttkr�|jjd#d$�ntjd%|jd&d'�|_dS((Ntmethodttypetstrtrequiredtchoicestloopbacktmanualtdhcptstatict
ip_address_1gtip_address_10gt	subnet_1gt
subnet_10gtgateway_address_1gtgateway_address_10gtmtu_1gtdefaultt1500tmtu_10gtdns_nameserverstlisttdns_search_domainstbond_mode_1gt
ActivePassivetALBtLACPt
bond_mode_10gtlacp_1gtSlowtFasttlacp_10gtvirtual_network_tagt
argument_spectsupports_check_modetmsgs)Unable to import the SolidFire Python SDKtmoduletporti�(tnetapp_utilstontap_sf_host_argument_specR-tupdatetdicttTrueRR0tparamsR
RRRRRRRRR R"R#R'R(R+R,t
HAS_SF_SDKtFalset	fail_jsontcreate_sf_connectiontsfe(tselftinput_params((sb/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_network_interfaces.pyt__init__�sR'$$!!	















cC`s]y|jjd|j�Wn<tk
rX}|jjddt|�dtj��nXdS(s+
        set network configuration
        tnetworkR/s!Error network setting for node %st	exceptionN(	R<tset_network_configtnetwork_objectt	ExceptionR0R:R	t	tracebackt
format_exc(R=texception_object((sb/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_network_interfaces.pyRB�s
cC`s&y�td|jd|jd|jd|jd|jd|jd|jd|jd	|j	d
|j
�
}td|jd|jd|jd|j
d|jd|jd|jd|jd	|jd
|j
�
}td|d|�}|SWn<tk
r!}|jjd
dt|�dt|��nXdS(s�
        Get Element SW Network object
        :description: get Network object

        :return: NetworkConfig object
        :rtype: object(NetworkConfig object)
        R
taddresstnetmasktgatewaytmtuR t
dns_searcht	bond_modetbond_lacp_rateR,tbond1_gtbond10_gR/sKError with setting up network object for node 1G and 10G configuration : %sRAN(RR
RRRRR R"R#R(R,RRRRR'R+R
RDR0R:R	(R=tbond_1g_networktbond_10g_networkRCte((sb/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_network_interfaces.pytget_network_params_object�s6																	cC`s`t}d}|j�|_|jdk	r=|j�t}nd}|jjd|d|�dS(sM
        Check connection and initialize node with cluster ownership
        s%Skipping changes, No change requestedtchangedR/N(R9tNoneRTRCRBR6R0t	exit_json(R=RUtresult_message((sb/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_network_interfaces.pytapplys
	(t__name__t
__module__t__doc__R?RBRTRY(((sb/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_network_interfaces.pyR�s
	2	
	$cC`st�}|j�dS(s
    Main function
    N(RRY(telementsw_network_interfaces((sb/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_network_interfaces.pytmain s	t__main__( R\t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNREtansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR2t
has_sf_sdkR8tsolidfire.modelsR
RR6RDR9tobjectRR^RZ(((sb/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_network_interfaces.pyt<module>s,


m	


t	

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