-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] ldap.managed entries keep getting reapplied #57212
Comments
I assume this problem was introduced with a change in salt/modules/ldap3.py related to #48666, which was not reflected in salt/states/ldap.py. On my system, I applied the following patch to work around the issue for the replace directive:
DISCLAIMER: This works for me (I'm only using the default und replace directives). I'm not familiar enough with the code, so I can't tell if this is a reasonable patch or if there might be side effects. |
We needed a bit more in the patch:
I wonder if something might also need doing in:
But we're not using delete, so maybe this is OK? I'm not sure this is a complete fix though as when the state is applied, we get an error message:
Though the |
ZD-6163. This is a more serious problem when using LDAP servers that will reject no-op changes, such as (I think) Oracle Unified Directory. Reproduced in 3002.2. |
I am going to attempt to get this looked at in the |
@twangboy I ran a few tests on a v3000.2 setup patched using the changes from the pull request and it seems to resolve the problem. |
Description
When using
ldap.managed
to manage entries in OpenLDAP it keeps re-applying the correct values and fails to detect that they are already correct.Setup
Debian 10/buster minion with OpenLDAP installed and the following
test.sls
state file:Steps to Reproduce the behavior
Expected behavior
No changes are applied.
Versions Report
Using current master d750d86
Additional context
It seems to be caused by mixing strings and bytes in the salt/states/ldap.py.
Looking at the output of
old
andnew
fromold, new = _process_entries(l, entries)
we get the following:old
:new
:we can see that the
olcRootDN
andolcSuffix
entries returned for the LDAP server inold
are bytes, but the same entries are strings innew
.The text was updated successfully, but these errors were encountered: