From 68325dbfe24adc6ae07eee95b66d580109ffe7f5 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Sun, 21 Jun 2015 01:43:35 -0400 Subject: [PATCH] fixed remote tmp creation when becoem user is not root and '~/' instead of $HOME is the default --- lib/ansible/plugins/shell/sh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/shell/sh.py b/lib/ansible/plugins/shell/sh.py index f7ba06d9318..3385d9fb04c 100644 --- a/lib/ansible/plugins/shell/sh.py +++ b/lib/ansible/plugins/shell/sh.py @@ -62,7 +62,7 @@ class ShellModule(object): if not basefile: basefile = 'ansible-tmp-%s-%s' % (time.time(), random.randint(0, 2**48)) basetmp = self.join_path(C.DEFAULT_REMOTE_TMP, basefile) - if system and basetmp.startswith('$HOME'): + if system and basetmp.startswith('$HOME') or basetmp.startswith('~/'): basetmp = self.join_path('/tmp', basefile) cmd = 'mkdir -p %s' % basetmp if mode: