|
|
@ -14,14 +14,13 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
|
|
|
|
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
module: na_ontap_service_processor_network
|
|
|
|
module: na_ontap_service_processor_network
|
|
|
|
short_description: Manage NetApp Ontap service processor network
|
|
|
|
short_description: Manage NetApp ONTAP service processor network
|
|
|
|
extends_documentation_fragment:
|
|
|
|
extends_documentation_fragment:
|
|
|
|
- netapp.na_ontap
|
|
|
|
- netapp.na_ontap
|
|
|
|
version_added: '2.6'
|
|
|
|
version_added: '2.6'
|
|
|
|
author:
|
|
|
|
author: NetApp Ansible Team (ng-ansibleteam@netapp.com)
|
|
|
|
- Chris Archibald (carchi@netapp.com), Kevin Hutton (khutton@netapp.com)
|
|
|
|
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Modify a Ontap service processor network
|
|
|
|
- Modify a ONTAP service processor network
|
|
|
|
options:
|
|
|
|
options:
|
|
|
|
state:
|
|
|
|
state:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -37,7 +36,7 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specify whether to enable or disable the service processor network.
|
|
|
|
- Specify whether to enable or disable the service processor network.
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
choices: ['true', 'false']
|
|
|
|
type: bool
|
|
|
|
node:
|
|
|
|
node:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- The node where the the service processor network should be enabled
|
|
|
|
- The node where the the service processor network should be enabled
|
|
|
@ -98,7 +97,7 @@ class NetAppOntapServiceProcessorNetwork(object):
|
|
|
|
self.argument_spec.update(dict(
|
|
|
|
self.argument_spec.update(dict(
|
|
|
|
state=dict(required=False, choices=['present'], default='present'),
|
|
|
|
state=dict(required=False, choices=['present'], default='present'),
|
|
|
|
address_type=dict(required=True, choices=['ipv4', 'ipv6']),
|
|
|
|
address_type=dict(required=True, choices=['ipv4', 'ipv6']),
|
|
|
|
is_enabled=dict(required=True, choices=['true', 'false']),
|
|
|
|
is_enabled=dict(required=True, type='bool'),
|
|
|
|
node=dict(required=True, type='str'),
|
|
|
|
node=dict(required=True, type='str'),
|
|
|
|
dhcp=dict(required=False, choices=['v4', 'none']),
|
|
|
|
dhcp=dict(required=False, choices=['v4', 'none']),
|
|
|
|
gateway_ip_address=dict(required=False, type='str'),
|
|
|
|
gateway_ip_address=dict(required=False, type='str'),
|
|
|
@ -147,8 +146,6 @@ class NetAppOntapServiceProcessorNetwork(object):
|
|
|
|
spn_info = netapp_utils.zapi.NaElement(
|
|
|
|
spn_info = netapp_utils.zapi.NaElement(
|
|
|
|
'service-processor-network-info')
|
|
|
|
'service-processor-network-info')
|
|
|
|
spn_info.add_new_child('node', self.node)
|
|
|
|
spn_info.add_new_child('node', self.node)
|
|
|
|
spn_info.add_new_child('address-type', self.address_type)
|
|
|
|
|
|
|
|
spn_info.add_new_child('is-enabled', self.is_enabled)
|
|
|
|
|
|
|
|
query = netapp_utils.zapi.NaElement('query')
|
|
|
|
query = netapp_utils.zapi.NaElement('query')
|
|
|
|
query.add_child_elem(spn_info)
|
|
|
|
query.add_child_elem(spn_info)
|
|
|
|
spn_get_iter.add_child_elem(query)
|
|
|
|
spn_get_iter.add_child_elem(query)
|
|
|
@ -190,7 +187,7 @@ class NetAppOntapServiceProcessorNetwork(object):
|
|
|
|
'service-processor-network-modify')
|
|
|
|
'service-processor-network-modify')
|
|
|
|
service_obj.add_new_child("node", self.node)
|
|
|
|
service_obj.add_new_child("node", self.node)
|
|
|
|
service_obj.add_new_child("address-type", self.address_type)
|
|
|
|
service_obj.add_new_child("address-type", self.address_type)
|
|
|
|
service_obj.add_new_child("is-enabled", self.is_enabled)
|
|
|
|
service_obj.add_new_child("is-enabled", str(self.is_enabled).lower())
|
|
|
|
|
|
|
|
|
|
|
|
if self.dhcp:
|
|
|
|
if self.dhcp:
|
|
|
|
service_obj.add_new_child("dhcp", self.dhcp)
|
|
|
|
service_obj.add_new_child("dhcp", self.dhcp)
|
|
|
@ -228,19 +225,21 @@ class NetAppOntapServiceProcessorNetwork(object):
|
|
|
|
if spn_details:
|
|
|
|
if spn_details:
|
|
|
|
spn_exists = True
|
|
|
|
spn_exists = True
|
|
|
|
if self.state == 'present': # modify
|
|
|
|
if self.state == 'present': # modify
|
|
|
|
if (self.dhcp and
|
|
|
|
if (self.dhcp is not None and
|
|
|
|
self.dhcp != spn_details['dhcp_value']) or \
|
|
|
|
self.dhcp != spn_details['dhcp_value']) or \
|
|
|
|
(self.gateway_ip_address and
|
|
|
|
(self.gateway_ip_address is not None and
|
|
|
|
self.gateway_ip_address != spn_details['gateway_ip_address_value']) or \
|
|
|
|
self.gateway_ip_address != spn_details['gateway_ip_address_value']) or \
|
|
|
|
(self.ip_address and
|
|
|
|
(self.ip_address is not None and
|
|
|
|
self.ip_address != spn_details['ip_address_value']) or \
|
|
|
|
self.ip_address != spn_details['ip_address_value']) or \
|
|
|
|
(self.netmask and
|
|
|
|
(self.netmask is not None and
|
|
|
|
self.netmask != spn_details['netmask_value']) or \
|
|
|
|
self.netmask != spn_details['netmask_value']) or \
|
|
|
|
(self.prefix_length and str(self.prefix_length)
|
|
|
|
(self.prefix_length is not None and str(self.prefix_length)
|
|
|
|
!= spn_details['prefix_length_value']):
|
|
|
|
!= spn_details['prefix_length_value']) or \
|
|
|
|
|
|
|
|
(self.is_enabled is not None and str(self.is_enabled).lower()
|
|
|
|
|
|
|
|
!= spn_details['is_enabled_value']):
|
|
|
|
changed = True
|
|
|
|
changed = True
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
pass
|
|
|
|
self.module.fail_json(msg='Error No Service Processor for node: %s' % self.node)
|
|
|
|
if changed:
|
|
|
|
if changed:
|
|
|
|
if self.module.check_mode:
|
|
|
|
if self.module.check_mode:
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|