From f82b9394b9454fad4fd678e4c3ab854c97a1e9e3 Mon Sep 17 00:00:00 2001 From: Jaykumar Chhatbar <45447272+JchhatbarInfoblox@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:05:42 +0530 Subject: [PATCH] - [NPA-113] Unable to remove dhcp options from DHCP Range using ansible. (#248) --- plugins/module_utils/api.py | 2 +- plugins/modules/nios_range.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py index 6284b8c8..89f9d885 100644 --- a/plugins/module_utils/api.py +++ b/plugins/module_utils/api.py @@ -388,7 +388,7 @@ def run(self, ib_obj_type, ib_spec): if (ib_obj_type == NIOS_IPV4_NETWORK or ib_obj_type == NIOS_IPV6_NETWORK): proposed_object = convert_members_to_struct(proposed_object) - if ib_obj_type in {NIOS_IPV4_NETWORK_CONTAINER, NIOS_IPV6_NETWORK_CONTAINER, NIOS_IPV4_NETWORK, NIOS_IPV6_NETWORK}: + if ib_obj_type in {NIOS_IPV4_NETWORK_CONTAINER, NIOS_IPV6_NETWORK_CONTAINER, NIOS_IPV4_NETWORK, NIOS_IPV6_NETWORK, NIOS_RANGE}: # Iterate over each option and remove the 'num' key if current_object.get('options') or proposed_object.get('options'): diff --git a/plugins/modules/nios_range.py b/plugins/modules/nios_range.py index 1a8d0a6f..f2bc7515 100644 --- a/plugins/modules/nios_range.py +++ b/plugins/modules/nios_range.py @@ -44,6 +44,7 @@ of values (see suboptions). When configuring suboptions at least one of C(name) or C(num) must be specified. type: list + default: [] elements: dict suboptions: name: @@ -375,7 +376,7 @@ def main(): new_end_addr=dict(aliases=['new_end', 'new_last_addr', 'new_last'], type='str'), name=dict(type='str'), disable=dict(type='bool', default='false',), - options=dict(type='list', elements='dict', options=option_spec, transform=options), + options=dict(type='list', elements='dict', options=option_spec, transform=options, default=[]), member=dict(type='str'), failover_association=dict(type='str'), ms_server=dict(type='str'),