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
The module win_user_profile differentiates between already deleted and still existent accounts. This causes issues if the user never existed.
As an example, the user "user1" never existed on one system. If I run the module with name and state: absent I get the following error:
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: bei <ScriptBlock>, <Keine Datei>: Zeile 100
failed: [one_system] (item=user1) => {"ansible_loop_var": "item", "changed": false, "item": "user1", "msg": "Unhandled exception while executing module: Die Eigenschaft ProfileImagePath ist im Pfad HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\S-1-5-21-1677214107-1252868271-91609288-4038 nicht vorhanden."}
If I run with username and state: absent the output depends on the state of the account. Either the account still exists, but the profile is already deleted, then the status is OK if the user still exists and the profile also the status is CHANGED. If the user never existed the status is FAILED with following result:
failed: [one_system] (item=user1) => {"ansible_loop_var": "item", "changed": false, "item": "user1", "msg": "argument for username is of type System.String and we were unable to convert to sid: Manche oder alle Identitätsverweise konnten nicht übersetzt werden."}
Maybe I just overshoot my approach since I want to delete the accounts completely and running win_user and win_user_profile with status: absent is kind of redundant, but I think this module should always run with OK if the user and the user profile is absent and with CHANGED if the user is absent but the profile is not.
SUMMARY
The module win_user_profile differentiates between already deleted and still existent accounts. This causes issues if the user never existed.
As an example, the user "user1" never existed on one system. If I run the module with
name
andstate: absent
I get the following error:If I run with
username
andstate: absent
the output depends on the state of the account. Either the account still exists, but the profile is already deleted, then the status is OK if the user still exists and the profile also the status is CHANGED. If the user never existed the status is FAILED with following result:Maybe I just overshoot my approach since I want to delete the accounts completely and running
win_user
andwin_user_profile
withstatus: absent
is kind of redundant, but I think this module should always run with OK if the user and the user profile is absent and with CHANGED if the user is absent but the profile is not.ISSUE TYPE
COMPONENT NAME
community.windows.win_user_profile
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Windows 10 build: 19045.4651
STEPS TO REPRODUCE
user1
PB1
PB2
EXPECTED RESULTS
The Playbooks run with CHANGED for the first run and with OK for the second time
ACTUAL RESULTS
The Playbook 1 runs with CHANGED for the first time and with FAILED for second time.
The text was updated successfully, but these errors were encountered: