Skip to content

Conversation

@Mandizvidzafn
Copy link

@Mandizvidzafn Mandizvidzafn commented Jan 23, 2026

Fix Active Directory user management task in promotedc role

Summary

This PR fixes failures in the promotedc Ansible role related to Active Directory user configuration using the microsoft.ad.user module.

The issue was caused by invalid and missing parameters being passed to the module, which resulted in type conversion and parameter validation errors during playbook execution.

What was fixed

  1. Added "add" parameter to the groups parameter to convert users to list and not dict
  2. Corrected groups data structure to match the module’s expected format (list instead of System.Object[]).
  3. Ensured compatibility with microsoft.ad.user module parameter requirements.
  4. Restored successful execution of the Domain Admin user configuration task.

Root Cause

groups parameter only creates type System.Object[ ] not supported by microsoft.ad.user which cannot be converted to dict
Incorrect group data type caused Ansible to fail when converting PowerShell objects to a dictionary.

Impact

  • Ansible playbook now completes successfully.
  • Domain Controller promotion workflow proceeds without errors.
  • AD users are correctly created/updated and added to the intended groups.

Testing

  • vagrant provision goku completed successfully
  • promotedc role runs without failures
  • Domain Admin account correctly updated in Active Directory

Notes

This change improves reliability and ensures strict compliance with the microsoft.ad Ansible collection API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant