You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating win_domain users works fine, but whenever I re-run a task to configure my win_domain users, it fails saying "Unhandled exception while executing module: The specified account already exists." I've tried adding / removing attributes but nothing seems to work.
Looking at the win_domain_user Powershell code, I assume that $user_obj is somehow being set to $null when running Get-ADUser.
# /home/acharette/.local/lib/python3.6/site-packages/ansible_collections
Collection Version
----------------- -------
community.windows 1.7.0
# /home/acharette/.ansible/collections/ansible_collections
Collection Version
----------------- -------
community.windows 1.8.0
CONFIGURATION
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.6.9 (default, Jan 26 2021,
15:33:00) [GCC 8.4.0]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting
deprecation_warnings=False in ansible.cfg.
OS / ENVIRONMENT
Running on Elementary OS 5.1.7 Hera - built on Ubuntu 18.04.6 LTS
Targeting a VM in Azure running Windows (Windows Server 2019 Datacenter)
STEPS TO REPRODUCE
Command I run: ansible-playbook configure_users.yml
User data is loaded from a file in group_vars
Might do, meantime if you set the identity parameter you can use it in the meantime. That passes the parameter to the Get-ADUser -Identity cmdlet in PS.
What you might find though, is that the -Identity parameter for your users is resolves to something else. In such a case, the change won't fix it. It'd be interesting to see how it resolves such an account (I don't have a way to test it to hand right this second).
A good way to test would be to allow the account to create then run the Get-ADUser command with -Identity set to the settings you have and see what returns the account. Whatever you set that parameter to to return the existing account is what identity should be set to.
SUMMARY
Creating win_domain users works fine, but whenever I re-run a task to configure my win_domain users, it fails saying "Unhandled exception while executing module: The specified account already exists." I've tried adding / removing attributes but nothing seems to work.
Looking at the win_domain_user Powershell code, I assume that $user_obj is somehow being set to $null when running Get-ADUser.
ISSUE TYPE
COMPONENT NAME
win_domain_user
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Running on Elementary OS 5.1.7 Hera - built on Ubuntu 18.04.6 LTS
Targeting a VM in Azure running Windows (Windows Server 2019 Datacenter)
STEPS TO REPRODUCE
Command I run: ansible-playbook configure_users.yml
User data is loaded from a file in group_vars
EXPECTED RESULTS
Task should report as ok, since the users already exist (verified by connecting to the server).
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: