diff --git a/changelogs/fragments/8877-keycloak_realm-sort-lists-before-change-detection.yaml b/changelogs/fragments/8877-keycloak_realm-sort-lists-before-change-detection.yaml new file mode 100644 index 00000000000..3e198662893 --- /dev/null +++ b/changelogs/fragments/8877-keycloak_realm-sort-lists-before-change-detection.yaml @@ -0,0 +1,2 @@ +bugfixes: + - keycloak_realm - fix change detection in check mode by sorting the lists in the realms beforehand (https://github.com/ansible-collections/community.general/pull/8877). \ No newline at end of file diff --git a/plugins/modules/keycloak_realm.py b/plugins/modules/keycloak_realm.py index 6128c9e4c7e..9bbcdb6b1a9 100644 --- a/plugins/modules/keycloak_realm.py +++ b/plugins/modules/keycloak_realm.py @@ -803,7 +803,7 @@ def main(): if module._diff: result['diff'] = dict(before=sanitize_cr(before_norm), after=sanitize_cr(desired_norm)) - result['changed'] = (before_realm != desired_realm) + result['changed'] = (before_norm != desired_norm) module.exit_json(**result)