Skip to content

Conversation

desand01
Copy link
Contributor

SUMMARY

Fixes an issue where keycloak_role incorrectly returns "changed" when using the alias clientId in composite roles.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

keycloak_role

ADDITIONAL INFORMATION
- name: Unchanged role with composites using aliases - should return no change
  community.general.keycloak_role:
    auth_keycloak_url: "{{ url }}"
    auth_realm: "{{ admin_realm }}"
    auth_username: "{{ admin_user }}"
    auth_password: "{{ admin_password }}"
    name: "Test"
    realm: "my-realm"
    description: "My composite role"
    composite: true
    composites:
      - name: view-clients
        clientId: "realm-management"
        state: present
      - name: query-clients
        clientId: "realm-management"
        state: present
    keycloak_client_id: test-client
    state: present
  register: result

@ansibullbot
Copy link
Collaborator

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

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this!

Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@felixfontein felixfontein merged commit 7c40c6b into ansible-collections:main Sep 18, 2025
137 checks passed
Copy link

patchback bot commented Sep 18, 2025

Backport to stable-10: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-10/7c40c6b6b5144ca471fc2a456b5e9409ce0fde21/pr-10829

Backported as #10838

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Sep 18, 2025
@felixfontein
Copy link
Collaborator

@desand01 thanks for your contribution!

patchback bot pushed a commit that referenced this pull request Sep 18, 2025
* Exclude aliases before comparison

* add test

* fragment

* Update changelogs/fragments/10829-fix-keycloak-role-changed-status.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Andre Desrosiers <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 7c40c6b)
Copy link

patchback bot commented Sep 18, 2025

Backport to stable-11: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-11/7c40c6b6b5144ca471fc2a456b5e9409ce0fde21/pr-10829

Backported as #10839

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Sep 18, 2025
* Exclude aliases before comparison

* add test

* fragment

* Update changelogs/fragments/10829-fix-keycloak-role-changed-status.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Andre Desrosiers <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 7c40c6b)
felixfontein added a commit that referenced this pull request Sep 18, 2025
…atus (#10838)

Keycloak role fix changed status (#10829)

* Exclude aliases before comparison

* add test

* fragment

* Update changelogs/fragments/10829-fix-keycloak-role-changed-status.yml



---------



(cherry picked from commit 7c40c6b)

Co-authored-by: desand01 <[email protected]>
Co-authored-by: Andre Desrosiers <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
@desand01 desand01 deleted the keycloak-role-fix-changed-status branch September 19, 2025 18:09
felixfontein added a commit that referenced this pull request Oct 5, 2025
…atus (#10839)

Keycloak role fix changed status (#10829)

* Exclude aliases before comparison

* add test

* fragment

* Update changelogs/fragments/10829-fix-keycloak-role-changed-status.yml



---------



(cherry picked from commit 7c40c6b)

Co-authored-by: desand01 <[email protected]>
Co-authored-by: Andre Desrosiers <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-10 Automatically create a backport for the stable-10 branch backport-11 Automatically create a backport for the stable-10 branch bug This issue/PR relates to a bug integration tests/integration module module plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants