1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add support for FlexCache to na_ontap_vserver_peer (#52301)

* Revert "changes to clusteR"

This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80.

* updates

* doc fix

* Revert "Revert "changes to clusteR""

This reverts commit 8e56b999e6cf6a65de339e516f7134a6b6b39cba.

* fix wrong fucntion
This commit is contained in:
Chris Archibald 2019-03-04 08:55:51 -08:00 committed by John R Barker
parent bf8ada0eb5
commit 725654f9d3

View file

@ -1,6 +1,6 @@
#!/usr/bin/python #!/usr/bin/python
# (c) 2018, NetApp, Inc # (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function from __future__ import absolute_import, division, print_function
__metaclass__ = type __metaclass__ = type
@ -27,9 +27,10 @@ options:
description: description:
- Specifies name of the source Vserver in the relationship. - Specifies name of the source Vserver in the relationship.
applications: applications:
choices: ['snapmirror', 'file_copy', 'lun_copy'] choices: ['snapmirror', 'file_copy', 'lun_copy', 'flexcache']
description: description:
- List of applications which can make use of the peering relationship. - List of applications which can make use of the peering relationship.
- FlexCache supported from ONTAP 9.5 onwards.
peer_vserver: peer_vserver:
description: description:
- Specifies name of the peer Vserver in the relationship. - Specifies name of the peer Vserver in the relationship.
@ -54,6 +55,7 @@ version_added: "2.7"
''' '''
EXAMPLES = """ EXAMPLES = """
- name: Source vserver peer create - name: Source vserver peer create
na_ontap_vserver_peer: na_ontap_vserver_peer:
state: present state: present
@ -65,6 +67,7 @@ EXAMPLES = """
username: "{{ netapp_username }}" username: "{{ netapp_username }}"
password: "{{ netapp_password }}" password: "{{ netapp_password }}"
dest_hostname: "{{ netapp_dest_hostname }}" dest_hostname: "{{ netapp_dest_hostname }}"
- name: vserver peer delete - name: vserver peer delete
na_ontap_vserver_peer: na_ontap_vserver_peer:
state: absent state: absent
@ -100,7 +103,7 @@ class NetAppONTAPVserverPeer(object):
vserver=dict(required=True, type='str'), vserver=dict(required=True, type='str'),
peer_vserver=dict(required=True, type='str'), peer_vserver=dict(required=True, type='str'),
peer_cluster=dict(required=False, type='str'), peer_cluster=dict(required=False, type='str'),
applications=dict(required=False, type='list', choices=['snapmirror', 'file_copy', 'lun_copy']), applications=dict(required=False, type='list', choices=['snapmirror', 'file_copy', 'lun_copy', 'flexcache']),
dest_hostname=dict(required=False, type='str'), dest_hostname=dict(required=False, type='str'),
dest_username=dict(required=False, type='str'), dest_username=dict(required=False, type='str'),
dest_password=dict(required=False, type='str', no_log=True) dest_password=dict(required=False, type='str', no_log=True)
@ -128,6 +131,8 @@ class NetAppONTAPVserverPeer(object):
if self.parameters.get('dest_password'): if self.parameters.get('dest_password'):
self.module.params['password'] = self.parameters['dest_password'] self.module.params['password'] = self.parameters['dest_password']
self.dest_server = netapp_utils.setup_na_ontap_zapi(module=self.module) self.dest_server = netapp_utils.setup_na_ontap_zapi(module=self.module)
# reset to source host connection for asup logs
self.module.params['hostname'] = self.parameters['hostname']
def vserver_peer_get_iter(self): def vserver_peer_get_iter(self):
""" """
@ -240,6 +245,9 @@ class NetAppONTAPVserverPeer(object):
""" """
Apply action to create/delete or accept vserver peer Apply action to create/delete or accept vserver peer
""" """
results = netapp_utils.get_cserver(self.server)
cserver = netapp_utils.setup_na_ontap_zapi(module=self.module, vserver=results)
netapp_utils.ems_log_event("na_ontap_vserver_peer", cserver)
current = self.vserver_peer_get() current = self.vserver_peer_get()
cd_action = self.na_helper.get_cd_action(current, self.parameters) cd_action = self.na_helper.get_cd_action(current, self.parameters)
if cd_action == 'create': if cd_action == 'create':