From a71e19130d041752aa393be85c22adcb1ad63e7a Mon Sep 17 00:00:00 2001 From: Eike Waldt Date: Sat, 11 May 2024 16:54:23 +0200 Subject: [PATCH] keycloak_user_federation: fix diff of empty `krbPrincipalAttribute` (#8320) keycloak_user_federation: fix diff of empty `krbPrincipalAttribute` (#8320) --- ...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: