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

Add support for addressing subgroups by paths to the keycloak_user module #9898

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

christian-schlichtherle
SUMMARY

This PR fixes #9647 :

You can now address groups in the keycloak_user module by name (e.g. my-group) or by path (e.g. /foo/bar/baz). Using the path syntax adds support for managing membership of subgroups, which is not possible with ordinary names.

Along the way, it fixes minor bugs in group management and error handling.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

keycloak_user

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug identity module_utils module_utils new_contributor Help guide this first time contributor plugins plugin (any type) labels Mar 18, 2025
@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-9 Automatically create a backport for the stable-9 branch backport-10 Automatically create a backport for the stable-10 branch labels Mar 18, 2025
@russoz
Copy link
Collaborator

russoz commented Mar 20, 2025

LGTM from the point of view of Ansible, I do not know KC enough (nor have the time to) assess the logic.

@oraNod
Copy link
Contributor

oraNod commented Mar 21, 2025

LGTM from the point of view of Ansible, I do not know KC enough (nor have the time to) assess the logic.

It's somewhat off-topic but I was looking at these keycloak modules in c.general recently. Not sure if folks are aware but there is a separate keycloak collection at: https://github.com/ansible-middleware/keycloak

I know there are maintainers in that repo that work on keycloak and would be able to give much more detailed review of the logic side of things. It might be an idea to approach that team and discuss transferring modules out of c.general, especially as there is likely to be some overlap with functionality. If there's any interest in exploring that possibility I can help with it.

@felixfontein
Copy link
Collaborator

I do remember that there was another collection for some set of modules we have, and someone suggested something similar for that, but I'm not sure anymore whether that was a Keycloak collection or whether anyone actually tried to contact the maintainers of the other collection. (I can only say that I didn't.)

It would be great if there'd be a dedicated collection for Keycloak that would adopt our content in a way that's backwards compatible to our modules. That collection apparently forked the (or at least some) modules from community.general: ansible-middleware/keycloak#61 I'm not sure why they never talked to us (at least I don't find any reference), it would have been a lot easier to simply migrate our modules over to that collection. Now I guess the modules have developed in two different directions, which makes it hard to do such a transition now.

@oraNod
Copy link
Contributor

oraNod commented Mar 21, 2025

I do remember that there was another collection for some set of modules we have, and someone suggested something similar for that, but I'm not sure anymore whether that was a Keycloak collection or whether anyone actually tried to contact the maintainers of the other collection. (I can only say that I didn't.)

It would be great if there'd be a dedicated collection for Keycloak that would adopt our content in a way that's backwards compatible to our modules. That collection apparently forked the (or at least some) modules from community.general: ansible-middleware/keycloak#61 I'm not sure why they never talked to us (at least I don't find any reference), it would have been a lot easier to simply migrate our modules over to that collection. Now I guess the modules have developed in two different directions, which makes it hard to do such a transition now.

Thanks for pointing that hard fork @felixfontein That's not how we should be doing things around here, especially if there's no communication around it. I'll reach out to folks I know who work on the middleware collections and see what I can find out. @gundalow FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-9 Automatically create a backport for the stable-9 branch backport-10 Automatically create a backport for the stable-10 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. identity module_utils module_utils 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.

Unable to add a user to a sub-group when using the keycloak_user module
5 participants