From 0537e1d81e87f08b7559bf028d9b700a511a7954 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 17:11:27 +0200 Subject: [PATCH] [PR #8320/a71e1913 backport][stable-8] keycloak_user_federation: fix diff of empty `krbPrincipalAttribute` (#8340) 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 fee0d1265c..f87ef936ce 100644 --- a/plugins/modules/keycloak_user_federation.py +++ b/plugins/modules/keycloak_user_federation.py @@ -719,6 +719,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: