From 4f4d962f7c1076c3677899e103276c67cbdd53d9 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 21:46:37 +0300 Subject: [PATCH] [PR #8877/deaad6e5 backport][stable-9] keycloak_realm: fix change detection in check mode by normalizing realms beforehand (#8903) keycloak_realm: fix change detection in check mode by normalizing realms beforehand (#8877) * keycloak_realm: fix change detection in check mode by normalizing realms beforehand * add changelog fragment (cherry picked from commit deaad6e5479d214da1b762c6166135bcb03d419a) Co-authored-by: fgruenbauer --- .../8877-keycloak_realm-sort-lists-before-change-detection.yaml | 2 ++ plugins/modules/keycloak_realm.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/8877-keycloak_realm-sort-lists-before-change-detection.yaml 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)