mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Change the way we do with_items to make them happen next to each other in runner, which eliminates the problem of with_items and vars_files sometimes not playing nice with each other.
(Also a fix for the user module error handling when the user is not present at the time of the return. This can only really be caused by multiple ansible executions).
This commit is contained in:
@@ -54,6 +54,13 @@ def add_user_info(kwargs):
|
||||
if user_exists(name):
|
||||
kwargs['state'] = 'present'
|
||||
info = user_info(name)
|
||||
if info == False:
|
||||
if 'failed' in kwargs:
|
||||
kwargs['notice'] = "failed to look up user name: %s" % name
|
||||
else:
|
||||
kwargs['msg'] = "failed to look up user name: %s" % name
|
||||
kwargs['failed'] = True
|
||||
return kwargs
|
||||
kwargs['uid'] = info[2]
|
||||
kwargs['group'] = info[3]
|
||||
kwargs['comment'] = info[4]
|
||||
|
||||
Reference in New Issue
Block a user