-
Feature Request
-
Resolution: Unresolved
-
Normal
-
None
-
2.5
-
False
-
-
False
What is the nature and description of the request?
The current `microsoft.ldap.ad` inventory plugin marks attributes, sourced from external repository, as unsafe. This causes issues when trying to utilize the plugin in Ansible Automation Platform. The following issue occurs when trying to sync inventory with the plugin.
Traceback (most recent call last):
File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/tasks/jobs.py", line 1691, in post_run_hook
cmd.perform_update(options, data, inventory_update)
File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/management/commands/inventory_import.py", line 996, in perform_update
inventory = dict_to_mem_data(data, inventory=inventory)
File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/utils/mem_inventory.py", line 260, in dict_to_mem_data
host = inventory.get_host(hk)
File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/utils/mem_inventory.py", line 129, in get_host
m = ipv6_port_re.match(name)
TypeError: expected string or bytes-like object
Specifically, a customer may want to use one fo the attributes from AD as the name of the group via the `keyed_groups` parameter.
---
plugin: microsoft.ad.ldap
search_base: OU=domain,DC=example,DC=org
attributes:
memberOf:
computer_membership: this | map("regex_search", '^CN=(?P<name>.+?)((?<!\\),)', '\g<name>') | flatten
operatingSystem:
operating_system: this
name:
ad_name: this
inventory_hostname: ad_name | lower
groups:
Windows: '"Windows" in operating_system'
leading_separator: false
keyed_groups:
- key: computer_membership | default(omit)
default_value: unknown
Why does the customer need this? (List the business requirements here)
Customer would like to base group names on an attribute from Active Directory.
How would you like to achieve this? (List the functional requirements here)
- Update the inventory plugin to use the new data tagging feature in ansible-core