diff --git a/changelogs/fragments/diff_plugin.yml b/changelogs/fragments/diff_plugin.yml index 033f58f4b..90f868fee 100644 --- a/changelogs/fragments/diff_plugin.yml +++ b/changelogs/fragments/diff_plugin.yml @@ -2,4 +2,5 @@ bugfixes: - Fixed an issue where the usage access to instance_groups were removed - Fixed an issue where the diff doesn't work correctly when explicitly setting state present + - Fixed member removal of teams ... diff --git a/plugins/lookup/controller_object_diff.py b/plugins/lookup/controller_object_diff.py index db0b3135d..bb12e5ff9 100644 --- a/plugins/lookup/controller_object_diff.py +++ b/plugins/lookup/controller_object_diff.py @@ -330,6 +330,10 @@ def run(self, terms, variables=None, **kwargs): if self.get_option("set_absent"): for item in difference: item.update({"state": "absent"}) + if 'team' in item and item['role'] == 'member': + item.update({"target_team": item['team']}) + item.pop('team') + # Combine Lists if self.get_option("with_present"): for item in compare_list_reduced: