diff --git a/plugins/module_utils/_keycloak.py b/plugins/module_utils/_keycloak.py index f80cabae44..9108e523f4 100644 --- a/plugins/module_utils/_keycloak.py +++ b/plugins/module_utils/_keycloak.py @@ -1103,7 +1103,7 @@ class KeycloakAPI: def get_user_by_username(self, username: str, realm: str = "master") -> dict[str, t.Any] | None: """Fetch a keycloak user within a realm based on its username. - + If the username is not found, None is returned. :param username: Username of the user to fetch. :param realm: Realm in which the user resides; default 'master'""" @@ -1123,7 +1123,6 @@ class KeycloakAPI: except Exception as e: self.fail_request(e, msg=f"Could not obtain the user for realm {realm} and username {username}: {e}") - def get_service_account_user_by_client_id(self, client_id, realm: str = "master"): """Fetch a keycloak service account user within a realm based on its client_id. diff --git a/plugins/modules/keycloak_clientsecret_info.py b/plugins/modules/keycloak_clientsecret_info.py index 99e8003923..fb304cefb6 100644 --- a/plugins/modules/keycloak_clientsecret_info.py +++ b/plugins/modules/keycloak_clientsecret_info.py @@ -104,11 +104,6 @@ EXAMPLES = r""" """ RETURN = r""" -msg: - description: Textual description of whether we succeeded or failed. - returned: always - type: str - clientsecret_info: description: Representation of the client secret. returned: on success diff --git a/plugins/modules/keycloak_realm_users_info.py b/plugins/modules/keycloak_realm_users_info.py index 51a9e12943..997e63d24a 100644 --- a/plugins/modules/keycloak_realm_users_info.py +++ b/plugins/modules/keycloak_realm_users_info.py @@ -63,12 +63,6 @@ EXAMPLES = r""" """ RETURN = r""" -msg: - description: Status message about the action performed. - returned: always - type: str - sample: "Got users in realm MyCustomRealm" - users: description: List of users in the specified realm. returned: always @@ -81,12 +75,6 @@ users: - id: "2345-6789-01" username: "user2" email: "user2@example.com" - -changed: - description: Indicates if any changes were made (always False, as this is a read-only operation). - returned: always - type: bool - sample: false """ from ansible.module_utils.basic import AnsibleModule @@ -100,17 +88,9 @@ from ansible_collections.community.general.plugins.module_utils._keycloak import def main(): - """ - Module execution - - :return: - """ argument_spec = keycloak_argument_spec() - meta_args = dict( - realm=dict(default="master"), - ) - argument_spec.update(meta_args) + argument_spec["realm"] = dict(default="master") module = AnsibleModule( argument_spec=argument_spec, @@ -134,10 +114,7 @@ def main(): realm = module.params.get("realm") - users = kc.get_realm_users(realm=realm) - - result["users"] = users - result["msg"] = f"Got users in realm {realm}" + result["users"] = kc.get_realm_users(realm=realm) module.exit_json(**result)