diff --git a/plugins/modules/ipaautomember.py b/plugins/modules/ipaautomember.py index 027140100e..eb5dec19ca 100644 --- a/plugins/modules/ipaautomember.py +++ b/plugins/modules/ipaautomember.py @@ -450,6 +450,10 @@ def main(): commands = [] for name in names: + _type = None + inclusive_add, inclusive_del = [], [] + exclusive_add, exclusive_del = [], [] + # Make sure automember rule exists res_find = find_automember(ansible_module, name, automember_type) @@ -495,16 +499,12 @@ def main(): transform_conditions(inclusive), res_find.get("automemberinclusiveregex", []) ) - else: - inclusive_add, inclusive_del = [], [] if exclusive is not None: exclusive_add, exclusive_del = gen_add_del_lists( transform_conditions(exclusive), res_find.get("automemberexclusiveregex", []) ) - else: - exclusive_add, exclusive_del = [], [] elif action == "member": if res_find is None: @@ -512,9 +512,7 @@ def main(): msg="No automember '%s'" % name) inclusive_add = transform_conditions(inclusive or []) - inclusive_del = [] exclusive_add = transform_conditions(exclusive or []) - exclusive_del = [] for _inclusive in inclusive_add: key, regex = _inclusive.split("=", 1) diff --git a/plugins/modules/ipadnsforwardzone.py b/plugins/modules/ipadnsforwardzone.py index 93a31f5ec0..1397934eef 100644 --- a/plugins/modules/ipadnsforwardzone.py +++ b/plugins/modules/ipadnsforwardzone.py @@ -250,6 +250,8 @@ def main(): operation = "add" invalid = [] + wants_enable = False + if state in ["enabled", "disabled"]: if action == "member": ansible_module.fail_json( diff --git a/plugins/modules/ipadnsrecord.py b/plugins/modules/ipadnsrecord.py index f027791c8a..c8559c49eb 100644 --- a/plugins/modules/ipadnsrecord.py +++ b/plugins/modules/ipadnsrecord.py @@ -1605,6 +1605,8 @@ def main(): res_find = find_dnsrecord(ansible_module, zone_name, name) + cmds = [] + if state == 'present': cmds = define_commands_for_present_state( ansible_module, zone_name, entry, res_find)