Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8877/deaad6e5 backport][stable-9] keycloak_realm: fix change detection in check mode by normalizing realms beforehand #8903

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Sep 23, 2024

This is a backport of PR #8877 as merged into main (deaad6e).

SUMMARY

The lists enabledEventTypes, otpSupportedApplications and supportedLocales are sorted (in the normalize function) for the diff but not when comparing realms for the changed parameter. So the module always detects a change in check mode but shows an empty diff:

TASK [kc1 - realm-1 - Update Keycloak realm] ************************************************************************************************************************************************************************
changed: [kc1]

To minimize the changes, the lists should be sorted before comparing the realms as well.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

keycloak_realm

ADDITIONAL INFORMATION
  1. create minimal realm:
- name: Create or update Keycloak realm (minimal example)
  community.general.keycloak_realm:
    auth_client_id: admin-cli
    auth_keycloak_url: ...
    auth_realm: master
    auth_username: ...
    auth_password: ...
    id: realm-1
    realm: realm-1
    state: present
    enabledEventTypes:
    - AUTHREQID_TO_TOKEN
    - AUTHREQID_TO_TOKEN_ERROR
    - CLIENT_DELETE
    - CLIENT_DELETE_ERROR
  1. subsequent check runs always detect a change but show an empty diff

…lms beforehand (#8877)

* keycloak_realm: fix change detection in check mode by normalizing realms beforehand

* add changelog fragment

(cherry picked from commit deaad6e)
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor plugins plugin (any type) labels Sep 23, 2024
@felixfontein felixfontein merged commit 4f4d962 into stable-9 Sep 23, 2024
146 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-9/deaad6e5479d214da1b762c6166135bcb03d419a/pr-8877 branch September 23, 2024 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport bug This issue/PR relates to a bug module module new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants