mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Change na_ontap_disks to NetAppModule module format (#52279)
* Revert "changes to clusteR" This reverts commit 33ee1b71e4bc8435fb315762a871f8c4cb6c5f80. * disk changes * fix author * Revert "Revert "changes to clusteR"" This reverts commit 2c517792115179665d43d74780dc356ca41b9abe.
This commit is contained in:
parent
1da29c8ebe
commit
19f069c041
1 changed files with 5 additions and 7 deletions
|
@ -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
|
||||||
|
@ -31,7 +31,6 @@ options:
|
||||||
required: true
|
required: true
|
||||||
description:
|
description:
|
||||||
- It specifies the node to assign all visible unowned disks.
|
- It specifies the node to assign all visible unowned disks.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = """
|
||||||
|
@ -51,6 +50,7 @@ import traceback
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils._text import to_native
|
from ansible.module_utils._text import to_native
|
||||||
import ansible.module_utils.netapp as netapp_utils
|
import ansible.module_utils.netapp as netapp_utils
|
||||||
|
from ansible.module_utils.netapp_module import NetAppModule
|
||||||
|
|
||||||
|
|
||||||
HAS_NETAPP_LIB = netapp_utils.has_netapp_lib()
|
HAS_NETAPP_LIB = netapp_utils.has_netapp_lib()
|
||||||
|
@ -70,10 +70,8 @@ class NetAppOntapDisks(object):
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|
||||||
parameters = self.module.params
|
self.na_helper = NetAppModule()
|
||||||
|
self.parameters = self.na_helper.set_parameters(self.module.params)
|
||||||
# set up state variables
|
|
||||||
self.node = parameters['node']
|
|
||||||
|
|
||||||
if HAS_NETAPP_LIB is False:
|
if HAS_NETAPP_LIB is False:
|
||||||
self.module.fail_json(msg="the python NetApp-Lib module is required")
|
self.module.fail_json(msg="the python NetApp-Lib module is required")
|
||||||
|
@ -106,7 +104,7 @@ class NetAppOntapDisks(object):
|
||||||
enable aggregate (online).
|
enable aggregate (online).
|
||||||
"""
|
"""
|
||||||
assign_disk = netapp_utils.zapi.NaElement.create_node_with_children(
|
assign_disk = netapp_utils.zapi.NaElement.create_node_with_children(
|
||||||
'disk-sanown-assign', **{'node-name': self.node,
|
'disk-sanown-assign', **{'node-name': self.parameters['node'],
|
||||||
'all': 'true'})
|
'all': 'true'})
|
||||||
try:
|
try:
|
||||||
self.server.invoke_successfully(assign_disk,
|
self.server.invoke_successfully(assign_disk,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue