ansible-collections / microsoft.ad

Ansible collection for Active Directory management
GNU General Public License v3.0
39 stars 22 forks source link

Incorrect diff output for multiple-choice options #129

Open Yannik opened 3 months ago

Yannik commented 3 months ago
SUMMARY

For some reason, whenever microsoft.ad.group does a change (e.g. changing the group members), it also reports the scope to be changed like this:

-scope: 1
+scope: global
ISSUE TYPE
COMPONENT NAME

microsoft.ad.group

ANSIBLE VERSION
ansible [core 2.16.7]
  config file = /home/yannik/projects/xxx/ansible/ansible.cfg
  configured module search path = ['/home/yannik/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.12/site-packages/ansible
  ansible collection location = /home/yannik/projects/xxx/ansible/vendor_collections
  executable location = /usr/local/bin/ansible
  python version = 3.12.3 (main, Apr 17 2024, 00:00:00) [GCC 13.2.1 20240316 (Red Hat 13.2.1-7)] (/usr/bin/python3)
  jinja version = 3.1.4
  libyaml = True
COLLECTION VERSION

1.6.0

Yannik commented 3 months ago

This seems to be a general problem with options that have a limited number of choices.

Same thing happens with category:

-category: 1
+category: security
jborean93 commented 2 months ago

Thanks for the bug report, the diff output generator is quite rudimentary as the data returned is the raw LDAP attribute value rather than the translated value the AD cmdlets may have added on top. We can certainly look into trying to improve situations like this but keep in mind there are probably other attributes where a similar problem occurs.