community.general.keycloak_realm_localization module – Allows management of Keycloak realm localization overrides via the Keycloak API
Note
This module is part of the community.general collection (version 12.6.1).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.keycloak_realm_localization.
New in community.general 12.4.0
Synopsis
- This module allows you to manage per-locale message overrides for a Keycloak realm using the Keycloak Admin REST API.
- Requires access via OpenID Connect; the connecting user/client must have sufficient privileges.
- The names of module options are snake_cased versions of the names found in the Keycloak API.
Parameters
Parameter | Comments |
|---|---|
auth_client_id string | OpenID Connect Default: |
auth_client_secret string | Client Secret to use in conjunction with |
auth_keycloak_url aliases: url string / required | URL to the Keycloak instance. |
auth_password aliases: password string | Password to authenticate for API access with. |
auth_realm string | Keycloak realm name to authenticate to for API access. |
auth_username aliases: username string | Username to authenticate for API access with. |
connection_timeout integer added in community.general 4.5.0 | Controls the HTTP connections timeout period (in seconds) to Keycloak API. Default: |
force boolean | If If Choices:
|
http_agent string added in community.general 5.4.0 | Configures the HTTP User-Agent header. Default: |
locale string / required | Locale code for which the overrides apply (for example, |
overrides list / elements=dictionary | List of overrides to ensure for the locale when Ignored when Default: |
|
key string / required |
The message key to override. |
|
value string |
The override value for the message key. If omitted, value defaults to an empty string. Default: |
parent_id string / required | Name of the realm that owns the locale overrides. |
refresh_token string added in community.general 10.3.0 | Authentication refresh token for Keycloak API. |
state string | Desired state of localization overrides for the given locale. On On Choices:
|
token string added in community.general 3.0.0 | Authentication token for Keycloak API. |
validate_certs boolean | Verify TLS certificates (do not disable this in production). Choices:
|
Attributes
Attribute | Support | Description |
|---|---|---|
action_group | Action group: community.general.keycloak | Use |
check_mode | Support: full | Can run in |
diff_mode | Support: full | Returns details on what has changed (or possibly needs changing in |
See Also
See also
- community.general.keycloak_realm
-
You can specify list of supported locales using
supported_locales.
Examples
- name: Replace all overrides for locale "en" (credentials auth)
community.general.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com/auth
auth_realm: master
auth_username: USERNAME
auth_password: PASSWORD
parent_id: my-realm
locale: en
state: present
force: true
overrides:
- key: greeting
value: "Hello"
- key: farewell
value: "Bye"
delegate_to: localhost
- name: Replace listed overrides for locale "en" (credentials auth)
community.general.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com/auth
auth_realm: master
auth_username: USERNAME
auth_password: PASSWORD
parent_id: my-realm
locale: en
state: present
force: false
overrides:
- key: greeting
value: "Hello"
- key: farewell
value: "Bye"
delegate_to: localhost
- name: Ensure only one override exists for locale "fi" (token auth)
community.general.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com/auth
token: TOKEN
parent_id: my-realm
locale: fi
state: present
force: true
overrides:
- key: app.title
value: "Sovellukseni"
delegate_to: localhost
- name: Remove all overrides for locale "de"
community.general.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com/auth
auth_realm: master
auth_username: USERNAME
auth_password: PASSWORD
parent_id: my-realm
locale: de
state: absent
force: true
delegate_to: localhost
- name: Remove only the listed overrides for locale "de"
community.general.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com/auth
auth_realm: master
auth_username: USERNAME
auth_password: PASSWORD
parent_id: my-realm
locale: de
state: absent
force: false
overrides:
- key: app.title
- key: foo
- key: bar
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
end_state dictionary | |
|
locale string |
The locale code affected. Returned: success Sample: |
|
overrides list / elements=dictionary |
The list of overrides that exist after execution. Returned: success Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/community/general/keycloak_realm_localization_module.html