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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddljjZddlmZej�Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
  - "Enable or disable HA on a cluster"
extends_documentation_fragment:
  - netapp.na_ontap
module: na_ontap_cluster_ha
options:
  state:
    choices: ['present', 'absent']
    description:
      - "Whether HA on cluster should be enabled or disabled."
    default: present
short_description: NetApp ONTAP Manage HA status for cluster
version_added: "2.6"
s�
    - name: "Enable HA status for cluster"
      na_ontap_cluster_ha:
        state: present
        hostname: "{{ netapp_hostname }}"
        username: "{{ netapp_username }}"
        password: "{{ netapp_password }}"
t
N(t
AnsibleModule(t	to_native(tNetAppModuletNetAppOntapClusterHAcB`s2eZdZd�Zd�Zd�Zd�ZRS(s-
    object initialize and class methods
    c
C`s�tj�|_|jjtdtdtdddgdd���td|jdt�|_t	�|_
|j
j|jj�|_
ttkr�|jjd	d
�ntjd|j�|_dS(Ntstatetrequiredtchoicestpresenttabsenttdefaultt
argument_spectsupports_check_modetmsgs(the python NetApp-Lib module is requiredtmodule(tnetapp_utilstna_ontap_host_argument_specRtupdatetdicttFalseR	tTrueRRt	na_helpertset_parameterstparamst
parameterstHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tself((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cluster_ha.pyt__init__8s%	cC`s�tjjjdi|d6�}y|jj|dt�WnHtjjk
r�}|jj	dd|t
|�fdtj��nXdS(sG
        Enable or disable HA on cluster
        :return: None
        scluster-ha-modifys
ha-configuredtenable_tunnelingRs$Error modifying cluster HA to %s: %st	exceptionN(
Rtzapit	NaElementtcreate_node_with_childrenR$tinvoke_successfullyRt
NaApiErrorRR"R
t	tracebackt
format_exc(R%t	configuretcluster_ha_modifyterror((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cluster_ha.pytmodify_cluster_haKscC`s�tjjd�}y|jj|dt�}Wn8tjjk
rh}|jjdddt	j
��nX|jd�jd�}|jd�d	kr�itd6Sd
S(sc
        Get current cluster HA details
        :return: dict if enabled, None if disabled
        scluster-ha-getR'Rs!Error fetching cluster HA detailsR(t
attributesscluster-ha-infos
ha-configuredttrueN(RR)R*R$R,RR-RR"R.R/tget_child_by_nametget_child_contenttNone(R%tcluster_ha_gettresultR2tcluster_ha_info((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cluster_ha.pytget_cluster_ha_enabledZs
cC`s�tj|j�}tjd|jd|�}tjd|�|j�}|jj||j	�}|dkr}|j
d�n|dkr�|j
d�n|jjd|jj�d	S(
s,
        Apply action to cluster HA
        Rtvservertna_ontap_cluster_hatcreateR5tdeletetfalsetchangedN(
Rtget_cserverR$R#Rt
ems_log_eventR<Rt
get_cd_actionR R3t	exit_jsonRB(R%tresultstcservertcurrentt	cd_action((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cluster_ha.pytapplyks(t__name__t
__module__t__doc__R&R3R<RK(((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cluster_ha.pyR4s
			cC`st�}|j�dS(s&
    Create object and call apply
    N(RRK(tha_obj((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cluster_ha.pytmain|s	t__main__(t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR.tansible.module_utils.basicR	tansible.module_utils._textR
tansible.module_utils.netapptmodule_utilstnetappRt"ansible.module_utils.netapp_moduleRthas_netapp_libR!tobjectRRPRL(((sV/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_cluster_ha.pyt<module>s"


	H	

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