From 490c7e7b35e10604307a3150515edf8eeb4b2feb Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 29 Aug 2018 21:39:37 +0100 Subject: [PATCH] Clarify docs/examples of attribute removal (#35872) If values="somestring" is specified then this module normalizes it to ["somestring"]. This means that passing name="foo", values="", state=exact results in the ldap entry having a single attribute called foo="". To delete all attributes "foo", regardless of their values, it is necessary to pass name="foo", values=[], state="exact". --- lib/ansible/modules/net_tools/ldap/ldap_attr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/net_tools/ldap/ldap_attr.py b/lib/ansible/modules/net_tools/ldap/ldap_attr.py index a3a50b0721..320fd74595 100644 --- a/lib/ansible/modules/net_tools/ldap/ldap_attr.py +++ b/lib/ansible/modules/net_tools/ldap/ldap_attr.py @@ -54,7 +54,7 @@ options: values will be added if they're missing. If C(absent), all given values will be removed if present. If C(exact), the set of values will be forced to exactly those provided and no others. If - I(state=exact) and I(value) is empty, all values for this + I(state=exact) and I(value) is an empty list, all values for this attribute will be removed. choices: [present, absent, exact] default: present @@ -117,7 +117,7 @@ EXAMPLES = """ ldap_attr: dn: uid=jdoe,ou=people,dc=example,dc=com name: shadowExpire - values: "" + values: [] state: exact server_uri: ldap://localhost/ bind_dn: cn=admin,dc=example,dc=com @@ -135,7 +135,7 @@ EXAMPLES = """ ldap_attr: dn: uid=jdoe,ou=people,dc=example,dc=com name: shadowExpire - values: "" + values: [] state: exact params: "{{ ldap_auth }}" """