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

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
ljjZddlmZddlmZej�Zydd
lZWnek
r�eZnXdefd��YZd�Zedkre�nd
S(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bysx

module: na_elementsw_cluster_pair

short_description: NetApp Element Software Manage Cluster Pair
extends_documentation_fragment:
    - netapp.solidfire
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Create, delete cluster pair

options:

    state:
      description:
      - Whether the specified cluster pair should exist or not.
      choices: ['present', 'absent']
      default: present

    dest_mvip:
      description:
      - Destination IP address of the cluster to be paired.
      required: true

    dest_username:
      description:
      - Destination username for the cluster to be paired.
      - Optional if this is same as source cluster username.

    dest_password:
      description:
      - Destination password for the cluster to be paired.
      - Optional if this is same as source cluster password.

s8
   - name: Create cluster pair
     na_elementsw_cluster_pair:
       hostname: "{{ src_hostname }}"
       username: "{{ src_username }}"
       password: "{{ src_password }}"
       state: present
       dest_mvip: "{{ dest_hostname }}"

   - name: Delete cluster pair
     na_elementsw_cluster_pair:
       hostname: "{{ src_hostname }}"
       username: "{{ src_username }}"
       password: "{{ src_password }}"
       state: absent
       dest_mvip: "{{ dest_hostname }}"
       dest_username: "{{ dest_username }}"
       dest_password: "{{ dest_password }}"

s

(t
AnsibleModule(t	to_nativeN(tNaElementSWModule(tNetAppModuletElementSWClusterPaircB`sMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s, class to handle cluster pairing operations cC`s�tj�|_|jjtdtdtdddgdd�dtdtdd	�d
tdtdd	�dtdtdd	dt���td
|jdt�|_t	tkr�|jj
dd�ntjd|j�|_t
|j�|_t�|_|jj|jj�|_|jd|jjd<|jjd
�rY|jd
|jjd<n|jjd�r�|jd|jjd<ntjd|j�|_t
|j�|_dS(sG
            Setup Ansible parameters and ElementSW connection
        tstatetrequiredtchoicestpresenttabsenttdefaultt	dest_mvipttypetstrt
dest_usernamet
dest_passwordtno_logt
argument_spectsupports_check_modetmsgs)Unable to import the SolidFire Python SDKtmodulethostnametusernametpasswordN(tnetapp_utilstontap_sf_host_argument_specRtupdatetdicttFalsetTrueRRt
HAS_SF_SDKt	fail_jsontcreate_sf_connectiontelemR
telementsw_helperRt	na_helpertset_parameterstparamst
parameterstgett	dest_elemtdest_elementsw_helper(tself((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pyt__init__\s.		cC`s.x'|jD]}|j|kr
|jSq
WdS(N(t
cluster_pairstmviptcluster_pair_idtNone(R2tpaired_clustersRtpair((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pytcheck_if_already_paired�scC`s&|jj�}|j||jd�S(s+
            Check for idempotency
        R(R)tlist_cluster_pairsR:R.(R2R8((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pytget_src_pair_id�scC`s&|jj�}|j||jd�S(s5
        Getting destination cluster_pair_id
        R(R0R;R:R.(R2R8((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pytget_dest_pair_id�scC`s�y)|jj�}|jjd|j�WnPtjjk
r{}|jj	dd|j
d|j
dfdt|��nXdS(sU
            Start cluster pairing on source, and complete on target cluster
        tcluster_pairing_keyRsError pairing cluster %s and %sRRt	exceptionN(R)tstart_cluster_pairingR0tcomplete_cluster_pairingR>t	solidfiretcommontApiServerErrorRR'R.R	(R2tpair_keyterr((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pyt
pair_clusters�s
cC`s�y*|jjd|�|jjd|�WnPtjjk
r|}|jjdd|jd|jdfdt	|��nXdS(s)
            Delete cluster pair
        R6Rs!Error unpairing cluster %s and %sRRR?N(
R)tremove_cluster_pairR0RBRCRDRR'R.R	(R2tpair_id_sourcetpair_id_destRF((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pytunpair_clusters�s
cC`s�|j�}|r!|j�}n|jj||j�}|dkrR|j�n|dkrq|j||�n|jjd|jj	�dS(s?
            Call create / delete cluster pair methods
        tcreatetdeletetchangedN(
R<R=R+t
get_cd_actionR.RGRKRt	exit_jsonRN(R2RIRJt	cd_action((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pytapply�s
(
t__name__t
__module__t__doc__R3R:R<R=RGRKRR(((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pyRYs	&					
cC`st�}|j�dS(s Apply cluster pair actions N(RRR(tcluster_obj((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pytmain�s	t__main__( t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.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&tsolidfire.commonRBtImportErrorR$tobjectRRWRS(((s\/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_elementsw_cluster_pair.pyt<module>s*


&

j	

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