.. Document meta :orphan: .. |antsibull-internal-nbsp| unicode:: 0xA0 :trim: .. meta:: :antsibull-docs: 2.24.0 .. Anchors .. _ansible_collections.middleware_automation.keycloak.keycloak_realm_localization_module: .. Anchors: short name for ansible.builtin .. Title keycloak_realm_localization -- Allows management of Keycloak realm localization overrides via the Keycloak API ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. Collection note .. 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 :code:`ansible-galaxy collection list`. To install it, use: :code:`ansible\-galaxy collection install middleware\_automation.keycloak`. To use it in a playbook, specify: :code:`middleware_automation.keycloak.keycloak_realm_localization`. .. version_added .. rst-class:: ansible-version-added New in middleware\_automation.keycloak 3.0.0 .. contents:: :local: :depth: 1 .. Deprecated Synopsis -------- .. Description - 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. .. Aliases .. Requirements .. Options Parameters ---------- .. raw:: html

Parameter

Comments

auth_client_id

string

OpenID Connect client_id to authenticate to the API with.

Default: "admin-cli"

auth_client_secret

string

Client Secret to use in conjunction with auth_client_id (if required).

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

Controls the HTTP connections timeout period (in seconds) to Keycloak API.

Default: 10

force

boolean

If false, only the keys listed in the overrides are modified by this module. Any other pre-existing keys are ignored.

If true, all locale overrides are made to match configuration of this module. For example any keys missing from the overrides are removed regardless of state value.

Choices:

  • false ← (default)

  • true

http_agent

string

Configures the HTTP User-Agent header.

Default: "Ansible"

locale

string / required

Locale code for which the overrides apply (for example, en, fi, de).

overrides

list / elements=dictionary

List of overrides to ensure for the locale when state=present. Each item is a mapping with the record's overrides[].key and its overrides[].value.

Ignored when state=absent.

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

Authentication refresh token for Keycloak API.

state

string

Desired state of localization overrides for the given locale.

On present, the set of overrides for the locale are made to match overrides. If force is true keys not listed in overrides are removed, and the listed keys are created or updated. If force is false keys not listed in overrides are ignored, and the listed keys are created or updated.

On absent, overrides for the locale is removed. If force is true, all keys are removed. If force is false, only the keys listed in overrides are removed.

Choices:

  • "present" ← (default)

  • "absent"

token

string

Authentication token for Keycloak API.

validate_certs

boolean

Verify TLS certificates (do not disable this in production).

Choices:

  • false

  • true ← (default)

.. Attributes Attributes ---------- .. tabularcolumns:: \X{2}{10}\X{3}{10}\X{5}{10} .. list-table:: :width: 100% :widths: auto :header-rows: 1 :class: longtable ansible-option-table * - Attribute - Support - Description * - .. raw:: html
.. _ansible_collections.middleware_automation.keycloak.keycloak_realm_localization_module__attribute-action_group: .. rst-class:: ansible-option-title **action_group** .. raw:: html .. raw:: html
- .. raw:: html
:ansible-attribute-support-property:`Action group:` |antsibull-internal-nbsp|:ansible-attribute-support-full:`middleware\_automation.keycloak.keycloak` .. raw:: html
- .. raw:: html
Use :literal:`group/middleware\_automation.keycloak.keycloak` in :literal:`module\_defaults` to set defaults for this module. .. raw:: html
* - .. raw:: html
.. _ansible_collections.middleware_automation.keycloak.keycloak_realm_localization_module__attribute-check_mode: .. rst-class:: ansible-option-title **check_mode** .. raw:: html .. raw:: html
- .. raw:: html
:ansible-attribute-support-label:`Support: \ `\ :ansible-attribute-support-full:`full` .. raw:: html
- .. raw:: html
Can run in :literal:`check\_mode` and return changed status prediction without modifying target. .. raw:: html
* - .. raw:: html
.. _ansible_collections.middleware_automation.keycloak.keycloak_realm_localization_module__attribute-diff_mode: .. rst-class:: ansible-option-title **diff_mode** .. raw:: html .. raw:: html
- .. raw:: html
:ansible-attribute-support-label:`Support: \ `\ :ansible-attribute-support-full:`full` .. raw:: html
- .. raw:: html
Will return details on what has changed (or possibly needs changing in :literal:`check\_mode`\ ), when in diff mode. .. raw:: html
.. Notes .. Seealso See Also -------- .. seealso:: :ref:`middleware\_automation.keycloak.keycloak\_realm ` You can specify list of supported locales using :ansopt:`middleware\_automation.keycloak.keycloak\_realm#module:supported\_locales`. .. Examples Examples -------- .. code-block:: yaml+jinja - 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 .. Facts .. Return values Return Values ------------- Common return values are documented :ref:`here `, the following are the fields unique to this module: .. raw:: html

Key

Description

end_state

dictionary

Final state of localization overrides for the locale after module execution.

Contains the locale and the list of overrides as key/value items.

Returned: on success

locale

string

The locale code affected.

Returned: success

Sample: "en"

overrides

list / elements=dictionary

The list of overrides that exist after execution.

Returned: success

Sample: [{"key": "greeting", "value": "Hello"}, {"key": "farewell", "value": "Bye"}]

.. Status (Presently only deprecated) .. Authors Authors ~~~~~~~ - Jakub Danek (@danekja) .. Extra links .. Parsing errors