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:
parent
31d9111857
commit
3d4efc0504
1 changed files with 7 additions and 0 deletions
7
user
7
user
|
@ -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]
|
||||
|
|
Loading…
Add table
Reference in a new issue