From 76f709286e8de7bc71d1dd2d722ef46728dac77f Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 6 Mar 2013 17:32:12 -0500 Subject: [PATCH] added check for starting $HOME for remote_tmp so as to non root sudo override Signed-off-by: Brian Coca --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index f06012137e..5e308c28a1 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -573,7 +573,7 @@ class Runner(object): basefile = 'ansible-%s-%s' % (time.time(), random.randint(0, 2**48)) basetmp = os.path.join(C.DEFAULT_REMOTE_TMP, basefile) - if self.sudo and self.sudo_user != 'root': + if self.sudo and self.sudo_user != 'root' and basetmp.startswith('$HOME'): basetmp = os.path.join('/tmp', basefile) cmd = 'mkdir -p %s' % basetmp