From be4e7fc374d884424703911fb26f9aed7cf78093 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 17:11:21 +0200 Subject: [PATCH] [PR #8320/a71e1913 backport][stable-7] keycloak_user_federation: fix diff of empty `krbPrincipalAttribute` (#8339) keycloak_user_federation: fix diff of empty `krbPrincipalAttribute` (#8320) keycloak_user_federation: fix diff of empty `krbPrincipalAttribute` (#8320) (cherry picked from commit a71e19130d041752aa393be85c22adcb1ad63e7a) Co-authored-by: Eike Waldt --- ...eycloak_user_federation-fix-diff-krbPrincipalAttribute.yaml | 2 ++ plugins/modules/keycloak_user_federation.py | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/8320-keycloak_user_federation-fix-diff-krbPrincipalAttribute.yaml diff --git a/changelogs/fragments/8320-keycloak_user_federation-fix-diff-krbPrincipalAttribute.yaml b/changelogs/fragments/8320-keycloak_user_federation-fix-diff-krbPrincipalAttribute.yaml new file mode 100644 index 0000000000..df4a892733 --- /dev/null +++ b/changelogs/fragments/8320-keycloak_user_federation-fix-diff-krbPrincipalAttribute.yaml @@ -0,0 +1,2 @@ +bugfixes: + - keycloak_user_federation - fix diff of empty ``krbPrincipalAttribute`` (https://github.com/ansible-collections/community.general/pull/8320). diff --git a/plugins/modules/keycloak_user_federation.py b/plugins/modules/keycloak_user_federation.py index b29cf21859..d713ca5537 100644 --- a/plugins/modules/keycloak_user_federation.py +++ b/plugins/modules/keycloak_user_federation.py @@ -712,6 +712,9 @@ def sanitize(comp): compcopy['config'] = dict((k, v[0]) for k, v in compcopy['config'].items()) if 'bindCredential' in compcopy['config']: compcopy['config']['bindCredential'] = '**********' + # an empty string is valid for krbPrincipalAttribute but is filtered out in diff + if 'krbPrincipalAttribute' not in compcopy['config']: + compcopy['config']['krbPrincipalAttribute'] = '' if 'mappers' in compcopy: for mapper in compcopy['mappers']: if 'config' in mapper: