From 33adf808fc1d0bff25e375d3553556f13d6dc4f0 Mon Sep 17 00:00:00 2001 From: fgruenbauer Date: Mon, 23 Sep 2024 20:29:40 +0200 Subject: [PATCH] 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 --- .../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)