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

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

fgruenbauer
Copy link
Contributor

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

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Sep 17, 2024
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-8 Automatically create a backport for the stable-8 branch backport-9 Automatically create a backport for the stable-9 branch labels Sep 17, 2024
@felixfontein
Copy link
Collaborator

If nobody objects, I'll merge this in a week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8 Automatically create a backport for the stable-8 branch backport-9 Automatically create a backport for the stable-9 branch bug This issue/PR relates to a bug check-before-release PR will be looked at again shortly before release and merged if possible. module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants