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_cluster.pyo

�
�Udac@`s�dZddlmZmZmZeZidd6dgd6dd6Zd	Zd
Z	dZ
ddlZdd
lm
Z
ddlmZddljjZddlmZej�Zdefd��YZd�Zedkr�e�ndS(s%
Element Software Initialize Cluster
i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys0

module: na_elementsw_cluster

short_description: NetApp Element Software Create Cluster
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Initialize Element Software node ownership to form a cluster.

options:
    management_virtual_ip:
        description:
        - Floating (virtual) IP address for the cluster on the management network.
        required: true

    storage_virtual_ip:
        description:
        - Floating (virtual) IP address for the cluster on the storage (iSCSI) network.
        required: true

    replica_count:
        description:
        - Number of replicas of each piece of data to store in the cluster.
        default: '2'

    cluster_admin_username:
        description:
        - Username for the cluster admin.
        - If not provided, default to login username.

    cluster_admin_password:
        description:
        - Initial password for the cluster admin account.
        - If not provided, default to login password.

    accept_eula:
        description:
        - Required to indicate your acceptance of the End User License Agreement when creating this cluster.
        - To accept the EULA, set this parameter to true.
        type: bool

    nodes:
        description:
        - Storage IP (SIP) addresses of the initial set of nodes making up the cluster.
        - nodes IP must be in the list.
        required: true

    attributes:
        description:
        - List of name-value pairs in JSON object format.
s�

  - name: Initialize new cluster
    tags:
    - elementsw_cluster
    na_elementsw_cluster:
      hostname: "{{ elementsw_hostname }}"
      username: "{{ elementsw_username }}"
      password: "{{ elementsw_password }}"
      management_virtual_ip: 10.226.108.32
      storage_virtual_ip: 10.226.109.68
      replica_count: 2
      accept_eula: true
      nodes:
      - 10.226.109.72
      - 10.226.109.74
sM

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

N(t
AnsibleModule(t	to_native(tNaElementSWModuletElementSWClustercB`s2eZdZd�Zd�Zd�Zd�ZRS(sO
    Element Software Initialize node with ownership for cluster formation
    cC`stj�|_|jjtdtdtdd�dtdtdd�dtdtdddd�d	tdtdd�d
tdtdddt�dtdtdd
�dtdtdt�dtdtdddd���t	d|jdt�|_
|j
j}|d|_|d|_
|d|_|jd�|_|jd�|_|d|_|jd	�|_|jd
�|_ttkr�|j
jdd�ntjd|j
�|_t|j�|_|jdk	r�|jj|jjdd��n|jjdd�|_dS(Ntmanagement_virtual_iptrequiredttypetstrtstorage_virtual_ipt
replica_counttdefaultt2tcluster_admin_usernametcluster_admin_passwordtno_logtaccept_eulatbooltnodest
attributestdictt
argument_spectsupports_check_modetmsgs)Unable to import the SolidFire Python SDKtmoduletsourcetna_elementsw_cluster(tnetapp_utilstontap_sf_host_argument_specRtupdateRtTruetFalsetlisttNoneRRtparamsRRRtgetRRRRRt
HAS_SF_SDKt	fail_jsontcreate_sf_connectiontsfeR
telementsw_helpertset_element_attributes(tselftinput_params((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster.pyt__init__rs:	



"cC`s�i|jd6|jd6|jd6|jd6|jd6|jd6}|jdk	ra|j|d<n|jdk	r�|j|d<ny|j	j
|�Wn<tk
r�}|jj
d	d
t|�dtj��nXdS(
s 
        Create Cluster
        tmviptsvipt	rep_countRRRtusernametpasswordRsError create cluster %st	exceptionN(RRRRRRRR(RR.tcreate_clustert	ExceptionRR,R	t	tracebackt
format_exc(R1toptionstexception_object((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster.pyR:�s 





cC`soyT|jjd|j�}|jjd|j�}|jjrO|jjrOtStSWnt	k
rj}tSXdS(s�
        Check connections to mvip, svip  address.
        :description: To test connection to given IP addressed for mvip and svip

        :rtype: bool
        R4R5N(
R.ttest_connect_mvipRttest_connect_svipRtdetailst	connectedR%R&R;(R1t	mvip_testt	svip_testte((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster.pytcheck_connection�scC`syt}d}|jjrV|jrV|j�r@|j�t}q\|jjdd�nd}|jj	d|d|�dS(sM
        Check connection and initialize node with cluster ownership
        Rs&Error connecting mvip and svip addresss%Skipping changes, No change requestedtchangedN(
R&R(RRRRGR:R%R,t	exit_json(R1RHtresult_message((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster.pytapply�s
	(t__name__t
__module__t__doc__R3R:RGRK(((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster.pyRms
	*		cC`st�}|j�dS(s
    Main function
    N(RRK(R!((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster.pytmain�s	t__main__(RNt
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR<tansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR"t,ansible.module_utils.netapp_elementsw_moduleR
t
has_sf_sdkR+tobjectRRORL(((sW/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster.pyt<module>s$


8	h	

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