Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Fix invalid OU check in user_groups module #481

Open
stahnjones opened this issue Jun 13, 2024 · 1 comment
Open

[Bug] Fix invalid OU check in user_groups module #481

stahnjones opened this issue Jun 13, 2024 · 1 comment
Assignees
Labels
1.9.3_triage Bug fixes & Improvements bug Something isn't working

Comments

@stahnjones
Copy link

Describe the bug
an AD group may be in an OU one or more layers deep, however the code checks only if the group DN contains ou= to trigger it as being an OU search instead of a group search.

To Reproduce
Steps to reproduce the behavior:

  • name: user_group playbook
    hosts: localhost
    gather_facts: false
    collections:
    • nutanix.ncp
      module_defaults:
      group/nutanix.ncp.ntnx:
      nutanix_host: <pc_ip>
      nutanix_username:
      nutanix_password:
      validate_certs: false
      tasks:

    • name: Setting Variables
      set_fact:
      distinguished_name: "cn=test_group,ou=groups,dc=nutanix,dc=com"
      directory_service_uuid: "<ds_uuid>"

    • name: create user group
      ntnx_user_groups:
      distinguished_name: "{{distinguished_name}}"
      register: result

Stack trace

Expected behavior
a group that is not in the root of the AD should be added as a group not searched for as an OU and fail

Additional context
Changing the check from "ou=" in config to some other check i.e. ( config[0:3] == "ou=" ) to ensure the proper object is searched for, as only an OU has a DN that starts with ou=.

@stahnjones stahnjones added the bug Something isn't working label Jun 13, 2024
@stahnjones
Copy link
Author

Pull 482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.9.3_triage Bug fixes & Improvements bug Something isn't working
Projects
Development

No branches or pull requests

6 participants