infobloxopen / infoblox-ansible

Ansible modules for interfacing to Infoblox systems
GNU General Public License v3.0
54 stars 61 forks source link

NIOS_ZONE type object is changed when run with --check #214

Open mkearey opened 6 months ago

mkearey commented 6 months ago

The module goes ahead and changes attributes in a zone when the --check option is set.

The plugins/modules/nios_zone.py has :

"notes:

But there is no logic around the section where NIOS_ZONE is handled in plugins/module_utils/api.py to test that --check is defined - It just runs the object update:

" if (ib_obj_type in (NIOS_ZONE)):

popping 'zone_format' key as update of 'zone_format' is not supported with respect to zone_auth

                proposed_object = self.on_update(proposed_object, ib_spec)
                del proposed_object['zone_format']
                self.update_object(ref, proposed_object)
                result['changed'] = True

"

This can be fixed with:

" if (ib_obj_type in (NIOS_ZONE)):

popping 'zone_format' key as update of 'zone_format' is not supported with respect to zone_auth

                proposed_object = self.on_update(proposed_object, ib_spec)
                del proposed_object['zone_format']
                if not self.module.check_mode:
                    res = self.update_object(ref, proposed_object)
                result['changed'] = True

"

If I figure out how to create the pull req and submit a patch I will, and update here