keycloak_realm_localization – Allows management of Keycloak realm localization overrides via the Keycloak API
Note
This module is part of the middleware_automation.keycloak collection.
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 middleware_automation.keycloak.
To use it in a playbook, specify: middleware_automation.keycloak.keycloak_realm_localization.
New in middleware_automation.keycloak 3.0.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 |
|---|---|
OpenID Connect client_id to authenticate to the API with. Default: |
|
Client Secret to use in conjunction with auth_client_id (if required). |
|
URL to the Keycloak instance. |
|
Password to authenticate for API access with. |
|
Keycloak realm name to authenticate to for API access. |
|
Username to authenticate for API access with. |
|
Controls the HTTP connections timeout period (in seconds) to Keycloak API. Default: |
|
If If Choices:
|
|
Configures the HTTP User-Agent header. Default: |
|
Locale code for which the overrides apply (for example, |
|
List of overrides to ensure for the locale when Ignored when Default: |
|
The message key to override. |
|
The override value for the message key. If omitted, value defaults to an empty string. Default: |
|
Name of the realm that owns the locale overrides. |
|
Authentication refresh token for Keycloak API. |
|
Desired state of localization overrides for the given locale. On On Choices:
|
|
Authentication token for Keycloak API. |
|
Verify TLS certificates (do not disable this in production). Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Action group: middleware_automation.keycloak.keycloak |
Use |
|
Support: full |
Can run in |
|
Support: full |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- middleware_automation.keycloak.keycloak_realm
You can specify list of supported locales using
supported_locales.
Examples
- name: Replace all overrides for locale "en" (credentials auth)
middleware_automation.keycloak.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com
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)
middleware_automation.keycloak.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com
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)
middleware_automation.keycloak.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com
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"
middleware_automation.keycloak.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com
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"
middleware_automation.keycloak.keycloak_realm_localization:
auth_client_id: admin-cli
auth_keycloak_url: https://auth.example.com
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 |
|---|---|
The locale code affected. Returned: success Sample: |
|
The list of overrides that exist after execution. Returned: success Sample: |