Repository: ansible-collections/community.general

Issue:
keycloak_realm: list of dicts should be list of strings
### Summary

Several `keycloak_realm` arguments expect `list / elements=dictionary`-type arguments when they should be expecting `list / elements=string`-type arguments:
https://github.com/ansible-collections/community.general/blob/996dc617edacfde398eae1067dbd04af3de42265/plugins/modules/identity/keycloak/keycloak_realm.py#L624-L628

Since this module [directly translates camelCased arguments to JSON](https://github.com/ansible-collections/community.general/blob/996dc617edacfde398eae1067dbd04af3de42265/plugins/module_utils/identity/keycloak/keycloak.py#L268) their types should match the types specified in Keycloak's [API documentation](https://www.keycloak.org/docs-api/17.0/rest-api/index.html#_realmrepresentation).

A similar issue was fixed in this PR:
https://github.com/ansible-collections/community.general/pull/3231/commits/57a4b40a9b9c17fb47de98913792be986d53d376

Tested on Keycloak v17.0.0.

### Issue Type

Bug Report

### Component Name

keycloak_realm

### Ansible Version

```console (paste below)
$ ansible --version
ansible [core 2.12.2]
  config file = /home/devium/code/kink/ansible.cfg
  configured module search path = ['/home/devium/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/devium/.local/lib/python3.8/site-packages/ansible
  ansible collection location = /home/devium/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/devium/.local/bin/ansible
  python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
  jinja version = 2.10.1
  libyaml = True

```


### Community.general Version

```console (paste below)
# /home/devium/.ansible/collections/ansible_collections
$ ansible-galaxy collection list community.general
Collection        Version
----------------- -------
community.general 4.4.0 
```


### Configuration

```console (paste below)
$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/home/devium/code/kink/ansible.cfg) = ['/home/devium/code/kink/inventories/dev/inventory.yml']
DEFAULT_REMOTE_USER(/home/devium/code/kink/ansible.cfg) = root
DEFAULT_STDOUT_CALLBACK(/home/devium/code/kink/ansible.cfg) = debug
HOST_KEY_CHECKING(/home/devium/code/kink/ansible.cfg) = False
```


### OS / Environment

Ubuntu 20.04 running in WSL

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
- name: Set realm's default client scopes
  community.general.keycloak_realm:
    auth_keycloak_url: https://auth.example.com/auth
    auth_realm: master
    auth_username: admin
    auth_password: changeme
    realm: myrealm
    default_default_client_scopes:
      - email
      - roles
      - web-origins
```


### Expected Results

The realm should no longer have `profile` listed in its default client scopes.

### Actual Results

```console (paste below)
fatal: [localhost]: FAILED! => {
    "changed": false
}

MSG:

Elements value for option 'default_default_client_scopes' is of type <class 'str'> and we were unable to convert to dict: dictionary requested, could not parse JSON or key=value

```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/identity/keycloak/keycloak_realm.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/identity/keycloak/keycloak_realm.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @eikef @kris2kris @ndclt
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Yes I think it's a real bug, maybe a review of code with keycloak admin documentation should be done.

Resolving patch:
diff --git a/plugins/modules/identity/keycloak/keycloak_realm.py b/plugins/modules/identity/keycloak/keycloak_realm.py
--- a/plugins/modules/identity/keycloak/keycloak_realm.py
+++ b/plugins/modules/identity/keycloak/keycloak_realm.py
@@ -163,7 +163,7 @@
         aliases:
             - defaultGroups
         type: list
-        elements: dict
+        elements: str
     default_locale:
         description:
             - The realm default locale.
@@ -183,7 +183,7 @@
         aliases:
             - defaultRoles
         type: list
-        elements: dict
+        elements: str
     default_signature_algorithm:
         description:
             - The realm default signature algorithm.
@@ -622,10 +622,10 @@ def main():
         client_authentication_flow=dict(type='str', aliases=['clientAuthenticationFlow']),
         client_scope_mappings=dict(type='dict', aliases=['clientScopeMappings']),
         default_default_client_scopes=dict(type='list', elements='str', aliases=['defaultDefaultClientScopes']),
-        default_groups=dict(type='list', elements='dict', aliases=['defaultGroups']),
+        default_groups=dict(type='list', elements='str', aliases=['defaultGroups']),
         default_locale=dict(type='str', aliases=['defaultLocale']),
         default_optional_client_scopes=dict(type='list', elements='str', aliases=['defaultOptionalClientScopes']),
-        default_roles=dict(type='list', elements='dict', aliases=['defaultRoles']),
+        default_roles=dict(type='list', elements='str', aliases=['defaultRoles']),
         default_signature_algorithm=dict(type='str', aliases=['defaultSignatureAlgorithm']),
         direct_grant_flow=dict(type='str', aliases=['directGrantFlow']),
         display_name=dict(type='str', aliases=['displayName']),


Test patch: