mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Make sure 'tmp' is in the remote tmp dirname to ensure correct cleanup
This commit is contained in:
@@ -868,7 +868,7 @@ class Runner(object):
|
|||||||
def _make_tmp_path(self, conn):
|
def _make_tmp_path(self, conn):
|
||||||
''' make and return a temporary path on a remote box '''
|
''' make and return a temporary path on a remote box '''
|
||||||
|
|
||||||
basefile = 'ansible-%s-%s' % (time.time(), random.randint(0, 2**48))
|
basefile = 'ansible-tmp-%s-%s' % (time.time(), random.randint(0, 2**48))
|
||||||
basetmp = os.path.join(C.DEFAULT_REMOTE_TMP, basefile)
|
basetmp = os.path.join(C.DEFAULT_REMOTE_TMP, basefile)
|
||||||
if self.sudo and self.sudo_user != 'root' and basetmp.startswith('$HOME'):
|
if self.sudo and self.sudo_user != 'root' and basetmp.startswith('$HOME'):
|
||||||
basetmp = os.path.join('/tmp', basefile)
|
basetmp = os.path.join('/tmp', basefile)
|
||||||
|
|||||||
Reference in New Issue
Block a user