Comments (2)
Looks like the problem isn't the OU but the length of the group name. The lookup code has a check to see if the input value is between 1-20 characters and if so search by sAMAccountName
microsoft.ad/plugins/module_utils/_ADObject.psm1
Lines 562 to 564 in 55831e6
As TEST-MS-SQL-Server-abc-Administratoren
exceeds 20 characters it's just going to try and find it by DistinguishedName
which won't work. The following is a quick reproducer:
- hosts: ...
gather_facts: false
tasks:
- block:
- name: create OU1
microsoft.ad.ou:
name: OU1
state: present
register: ou1
- name: create OU2
microsoft.ad.ou:
name: OU2
state: present
register: ou2
- name: create Group1
microsoft.ad.group:
name: Group1
path: '{{ ou1.distinguished_name }}'
scope: domainlocal
register: group1
- name: create Group2
microsoft.ad.group:
name: Group2-ReallyLongGroupNameHere
path: '{{ ou2.distinguished_name }}'
scope: domainlocal
- name: add Group2 to Group1
microsoft.ad.group:
identity: Group1
members:
set:
- Group2-ReallyLongGroupNameHere
- name: get group membership
microsoft.ad.object_info:
identity: '{{ group1.object_guid }}'
properties: member
always:
- name: remove example OUs
microsoft.ad.ou:
name: '{{ item }}'
state: absent
loop:
- OU1
- OU2
When I change the regex from {1,20}
to just +
then the example above works. This is interesting because the docs for the sAMAccountName attribute states the maximum length is 20 characters but either that's out of date or just wrong. I'll have a play around and see what the next steps forward should be.
As a workaround you can use the distinguishedName
, securityIdentifier
, objectGuid
, or userPrincipalName
of the group in the yaml definition.
from microsoft.ad.
This has been fixed with #95
from microsoft.ad.
Related Issues (20)
- Encrypt LAPS credentials with ansible-vault HOT 4
- microsoft.ad.ldap inventory plugin attribute values ("__ansible_unsafe") HOT 5
- Docstring Does Match Code
- Logging verbosity HOT 2
- error in object_info Unable to find type [Microsoft.ActiveDirectory.Management.ADIdentityNotFoundException]. HOT 1
- microsoft.ad.inventory connecting to port 22 and not ldap HOT 7
- "changed": false, "distinguished_name": null, "msg": "New-ADUser failed: The specified account already exists", "object_guid": null HOT 2
- After migrating from win_domain_computer unable to remove computer from AD HOT 3
- microsoft.ad.membership add reboot timeout option HOT 2
- microsoft.ad.domain fails with 'InstallDNS' not recognized error HOT 3
- microsoft.ad.user groups documentation should detail which formats it accepts
- How do you actually execute modules in this collection (requires powershell)? HOT 7
- Adding members to a group requires an explicit path to be set HOT 3
- The system cannot find the file specified. HOT 4
- Ansible Semaphore compatibility HOT 1
- Unable to parse microsoft.ad.ldap.yaml HOT 3
- Add action_groups HOT 3
- microsoft.ad.object can't assign attribute PrincipalsAllowedToRetrieveManagedPassword HOT 2
- Not able to run module, giving an error AnsibleADObject not found HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft.ad.