Note
This filter plugin is part of the microsoft.ad collection (version 1.9.2).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install microsoft.ad.
To use it in a playbook, specify: microsoft.ad.split_dn.
New in microsoft.ad 1.8.0
DN) string value giving you the first/leaf RDN component or the remaining/parent RDN components.RDN) separated by ,.This describes the input of the filter, the value before | microsoft.ad.split_dn.
Parameter | Comments |
|---|---|
Input string / required | The LDAP DistinguishedName string to split. |
This describes keyword parameters of the filter. These are the values key1=value1, key2=value2 and so on in the following example: input | microsoft.ad.split_dn(key1=value1, key2=value2, ...)
Parameter | Comments |
|---|---|
section string | The DN section to return. Defaults to Set to Do not specify Choices:
|
See also
microsoft.ad.dn_escape filter
microsoft.ad.parse_dn filter
- name: Gets the leaf RDN of a DN
set_fact:
my_dn: '{{ "CN=Foo,DC=domain,DC=com" | microsoft.ad.split_dn }}'
# CN=Foo
- name: Gets the parent RDNs of a DN
set_fact:
my_dn: >-
{{
"CN=Acme\, Inc.,O=OrgName,C=AU+ST=Queensland" |
microsoft.ad.split_dn("parent")
}}
# O=OrgName,C=AU+ST=Queensland,
Key | Description |
|---|---|
Return value string | The split RDN components based on the section requested. Returned: success Sample: |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/microsoft/ad/split_dn_filter.html