mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
added ansible_remote_tmp inventory var (#26754)
* added ansible_remote_tmp inventory var * fixed horrible crime of no space after #
This commit is contained in:
@@ -241,11 +241,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
||||
use_system_tmp = True
|
||||
|
||||
tmp_mode = 0o700
|
||||
|
||||
if use_system_tmp:
|
||||
tmpdir = None
|
||||
else:
|
||||
tmpdir = self._remote_expand_user(C.DEFAULT_REMOTE_TMP, sudoable=False)
|
||||
tmpdir = self._remote_expand_user(self._play_context.remote_tmp_dir, sudoable=False)
|
||||
|
||||
cmd = self._connection._shell.mkdtemp(basefile, use_system_tmp, tmp_mode, tmpdir)
|
||||
result = self._low_level_execute_command(cmd, sudoable=False)
|
||||
|
||||
@@ -110,14 +110,16 @@ class ShellBase(object):
|
||||
# /var/tmp is not).
|
||||
|
||||
if system:
|
||||
if C.DEFAULT_REMOTE_TMP.startswith('/var/tmp'):
|
||||
# FIXME: create 'system tmp dirs' config/var and check tmpdir is in those values to allow for /opt/tmp, etc
|
||||
if tmpdir.startswith('/var/tmp'):
|
||||
basetmpdir = '/var/tmp'
|
||||
else:
|
||||
basetmpdir = '/tmp'
|
||||
elif tmpdir is None:
|
||||
basetmpdir = C.DEFAULT_REMOTE_TMP
|
||||
else:
|
||||
basetmpdir = tmpdir
|
||||
if tmpdir is None:
|
||||
basetmpdir = C.DEFAULT_REMOTE_TMP
|
||||
else:
|
||||
basetmpdir = tmpdir
|
||||
|
||||
basetmp = self.join_path(basetmpdir, basefile)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user