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

�
�Udac@`s�dZddlmZmZmZeZidd6dgd6dd6Zd	Zd
Z	dZ
ddlZdd
lm
Z
ddlmZddljjZddlmZddlmZej�Zdefd��YZd�Zedkr�e�ndS(s$
Element Software Configure cluster
i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�

module: na_elementsw_cluster_config

short_description: Configure Element SW Cluster
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.8'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Configure Element Software cluster.

options:
    modify_cluster_full_threshold:
        description:
        -  The capacity level at which the cluster generates an event
        -  Requires a stage3_block_threshold_percent or
        -  max_metadata_over_provision_factor or
        -  stage2_aware_threshold
        suboptions:
            stage3_block_threshold_percent:
                description:
                - The percentage below the "Error" threshold that triggers a cluster "Warning" alert

            max_metadata_over_provision_factor:
                description:
                - The number of times metadata space can be overprovisioned relative to the amount of space available

            stage2_aware_threshold:
                description:
                - The number of nodes of capacity remaining in the cluster before the system triggers a notification

    encryption_at_rest:
        description:
        - enable or disable the Advanced Encryption Standard (AES) 256-bit encryption at rest on the cluster
        choices: ['present', 'absent']

    set_ntp_info:
        description:
        - configure NTP on cluster node
        - Requires a list of one or more ntp_servers
        suboptions:
            ntp_servers:
                description:
                - list of NTP servers to add to each nodes NTP configuration

            broadcastclient:
                type: bool
                default: False
                description:
                - Enables every node in the cluster as a broadcast client

    enable_virtual_volumes:
        type: bool
        default: True
        description:
        - Enable the NetApp SolidFire VVols cluster feature
s9

  - name: Configure cluster
    tags:
    - elementsw_cluster_config
    na_elementsw_cluster_config:
      hostname: "{{ elementsw_hostname }}"
      username: "{{ elementsw_username }}"
      password: "{{ elementsw_password }}"
      modify_cluster_full_threshold:
        stage2_aware_threshold: 2
        stage3_block_threshold_percent: 10
        max_metadata_over_provision_factor: 2
      encryption_at_rest: absent
      set_ntp_info:
        broadcastclient: False
        ntp_servers:
        - 1.1.1.1
        - 2.2.2.2
      enable_virtual_volumes: True
sM

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

N(t
AnsibleModule(t	to_native(tNaElementSWModule(tNetAppModuletElementSWClusterConfigcB`s�eZdZd�Zd�Zd�Zd�Zd�Zd�Zdd�Z
dd�Zd	�Zdddd
�Z
d�ZRS(
s7
    Element Software Configure Element SW Cluster
    cC`setj�|_|jjtdtdddtdtdddd�dtdddd�d	tdddd���d
tdddd
dg�dtdddtdtdddt�dtdd���dtdddt���td|jdt�|_	t
�|_|jj|j	j
�|_ttkrI|j	jdd�ntjd|j	�|_dS(Ntmodify_cluster_full_thresholdttypetdicttoptionststage2_aware_thresholdtinttdefaulttstage3_block_threshold_percentt"max_metadata_over_provision_factortencryption_at_resttstrtchoicestpresenttabsenttset_ntp_infotbroadcastclienttbooltntp_serverstlisttenable_virtual_volumest
argument_spectsupports_check_modetmsgs)Unable to import the SolidFire Python SDKtmodule(tnetapp_utilstontap_sf_host_argument_specR!tupdateRtNonetFalsetTrueRR$Rt	na_helpertset_parameterstparamst
parameterst
HAS_SF_SDKt	fail_jsontcreate_sf_connectiontsfe(tself((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pyt__init__zs.	cC`s|jj�}|S(s
        get ntp info
        (R2tget_ntp_info(R3tntp_details((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytget_ntp_details�scC`s||k||kS(N((R3tprovided_ntp_serverstexisting_ntp_servers((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytcmp�scC`s|jj�}|S(s"
        get cluster info
        (R2tget_cluster_info(R3tcluster_details((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytget_cluster_details�scC`s3|jjdd�}|dk	r/|jdjSdS(s"
        get vvols status
        tfeaturetvvolsiN(R2tget_feature_statusR(tfeaturestenabled(R3tfeature_status((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytget_vvols_status�scC`s|jj�}|S(s,
        get cluster full threshold
        (R2tget_cluster_full_threshold(R3tcluster_full_threshold_status((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pyt!get_cluster_full_threshold_status�scC`sZy|jj||�Wn<tk
rU}|jjddt|�dtj��nXdS(s
        configure ntp
        R#sError configuring ntp %st	exceptionN(R2Rt	ExceptionR$R0R	t	tracebackt
format_exc(R3tserversRtexception_object((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytsetup_ntp_info�s
cC`s�yH|dkr%d}|jj�n"|dkrGd}|jj�nWnBtk
r�}|jjdd|t|�fdtj��nXdS(	s3
        enable/disable encryption at rest
        RtenableRtdisableR#sFailed to %s rest encryption %sRHN(	R2tenable_encryption_at_resttdisable_encryption_at_restRIR$R0R	RJRK(R3tstatetencryption_stateRM((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytset_encryption_at_rest�scC`s`y|jjd|�WnBtk
r[}|jjdd|t|�fdtj��nXdS(s 
        enable feature
        R>R#sError enabling %s %sRHN(R2tenable_featureRIR$R0R	RJRK(R3R>RM((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pyRV�s
"cC`sfy#|jjd|d|d|�Wn<tk
ra}|jjddt|�dtj��nXdS(s/
        modify cluster full threshold
        RRRR#s*Failed to modify cluster full threshold %sRHN(R2R
RIR$R0R	RJRK(R3RRRRM((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytset_cluster_full_threshold�sc
C`s;t}d}|jjd�dk	r$|j�}|j}|j}|j}|jjd�ddk	r~||jddks�|jjd�ddk	r�||jddks�|jjd�ddk	r$||jddkr$t}|j	|jdd|jdd|jdd�q$n|jjd�dk	r�|j
�}|jj}|dkrs|jddks�|dkr�|jdd	kr�t}|j
|jd�q�n|jjd
�dk	rh|j�}	|	j}
|	j}|jjd
�d|ks,|j|jjd
�d|
�d
krht}|j|jjd
�d|jjd
�d�qhn|jjd�dk	r|j�}|tkr�|jjd�tkr�t}|jd�q|tkr|jjd�tk	r|jjdd�qn|jjtkrd}n|jjd|d|�dS(s'
        Cluster configuration
        R
RRRRtdisabledRRBRRRRiR R?R#s4Error disabling vvols: this feature cannot be undonesCheck mode, skipping changestchangedN(R)R(R.tgetRGRRRR*RWR=tcluster_infotencryption_at_rest_stateRUR7RLRR:RNRDRVR$R0t
check_modet	exit_json(
R3RYtresult_messagetcluster_full_threshold_detailst
current_mmopft
current_s3btptcurrent_s2atR[t current_encryption_at_rest_stateR6Rtbroadcast_clienttcurrent_vvols_status((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytapply�sV					($$	N(t__name__t
__module__t__doc__R4R7R:R=RDRGR(RNRURVRWRg(((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pyRvs	$							
cC`st�}|j�dS(s
    Main function
    N(RRg(tna_elementsw_cluster_config((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pytmain>s	t__main__(Rjt
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRJtansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappR%t,ansible.module_utils.netapp_elementsw_moduleR
t"ansible.module_utils.netapp_moduleRt
has_sf_sdkR/tobjectRRlRh(((s^/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_config.pyt<module>s&


<	�	

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