From 825e17c1cfc33571b273984f195166f268b0850c Mon Sep 17 00:00:00 2001 From: Laurent Paumier <30328363+laurpaum@users.noreply.github.com> Date: Fri, 27 Aug 2021 06:17:04 +0200 Subject: [PATCH] Fix keycloak_realm module (#3231) * fix events_listeners element type add events_enabled parameter * Update plugins/modules/identity/keycloak/keycloak_realm.py Co-authored-by: Felix Fontein * add changelog * Update changelogs/fragments/3231-fix-keycloak-realm-events.yml Co-authored-by: Felix Fontein * Update changelogs/fragments/3231-fix-keycloak-realm-events.yml Co-authored-by: Felix Fontein * Update plugins/modules/identity/keycloak/keycloak_realm.py Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein --- .../fragments/3231-fix-keycloak-realm-events.yml | 5 +++++ plugins/modules/identity/keycloak/keycloak_realm.py | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/3231-fix-keycloak-realm-events.yml diff --git a/changelogs/fragments/3231-fix-keycloak-realm-events.yml b/changelogs/fragments/3231-fix-keycloak-realm-events.yml new file mode 100644 index 0000000000..9950ed2c59 --- /dev/null +++ b/changelogs/fragments/3231-fix-keycloak-realm-events.yml @@ -0,0 +1,5 @@ +bugfixes: + - keycloak_realm - element type for ``events_listeners`` parameter should be ``string`` instead of ``dict`` (https://github.com/ansible-collections/community.general/pull/3231). +minor_changes: + - keycloak_realm - add ``events_enabled`` parameter to allow activation or deactivation of login events (https://github.com/ansible-collections/community.general/pull/3231). + \ No newline at end of file diff --git a/plugins/modules/identity/keycloak/keycloak_realm.py b/plugins/modules/identity/keycloak/keycloak_realm.py index 95f79704ef..da37fa2723 100644 --- a/plugins/modules/identity/keycloak/keycloak_realm.py +++ b/plugins/modules/identity/keycloak/keycloak_realm.py @@ -242,6 +242,13 @@ options: - enabledEventTypes type: list elements: str + events_enabled: + description: + - Enables or disables login events for this realm. + aliases: + - eventsEnabled + type: bool + version_added: 3.6.0 events_expiration: description: - The realm events expiration. @@ -254,7 +261,7 @@ options: aliases: - eventsListeners type: list - elements: dict + elements: str failure_factor: description: - The realm failure factor. @@ -626,8 +633,9 @@ def main(): email_theme=dict(type='str', aliases=['emailTheme']), enabled=dict(type='bool'), enabled_event_types=dict(type='list', elements='str', aliases=['enabledEventTypes']), + events_enabled=dict(type='bool', aliases=['eventsEnabled']), events_expiration=dict(type='int', aliases=['eventsExpiration']), - events_listeners=dict(type='list', elements='dict', aliases=['eventsListeners']), + events_listeners=dict(type='list', elements='str', aliases=['eventsListeners']), failure_factor=dict(type='int', aliases=['failureFactor']), internationalization_enabled=dict(type='bool', aliases=['internationalizationEnabled']), login_theme=dict(type='str', aliases=['loginTheme']),