Skip to content

Commit

Permalink
fix:git module ignores remote_tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
narimantos committed Jan 24, 2020
1 parent 7bbf4ad commit 56b1b7b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/ansible/modules/source_control/git.py
Expand Up @@ -363,13 +363,12 @@ def get_submodule_update_params(module, git_path, cwd):
return params


def write_ssh_wrapper():
module_dir = get_module_path()
def write_ssh_wrapper(module_tmpdir):
try:
# make sure we have full permission to the module_dir, which
# may not be the case if we're sudo'ing to a non-root user
if os.access(module_dir, os.W_OK | os.R_OK | os.X_OK):
fd, wrapper_path = tempfile.mkstemp(prefix=module_dir + '/')
fd, wrapper_path = tempfile.mkstemp(prefix=module_tmpdir + '/')
else:
raise OSError
except (IOError, OSError):
Expand Down Expand Up @@ -1142,7 +1141,7 @@ def main():
# create a wrapper script and export
# GIT_SSH=<path> as an environment variable
# for git to use the wrapper script
ssh_wrapper = write_ssh_wrapper()
ssh_wrapper = write_ssh_wrapper(module.tmpdir)
set_git_ssh(ssh_wrapper, key_file, ssh_opts)
module.add_cleanup_file(path=ssh_wrapper)

Expand Down

0 comments on commit 56b1b7b

Please sign in to comment.