From 3d4efc0504f3dd85e42da79278ee54cbc1362a6a Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 14 Jul 2012 19:18:33 -0400 Subject: [PATCH] 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). --- user | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/user b/user index da33f30cb06..61bb80ce9cc 100755 --- a/user +++ b/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]