From f8005d27379c4d67bc86cf6af83ba1b1823bb10f Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 14 Sep 2017 23:27:55 -0400 Subject: [PATCH] fix git wrapper (#29069) * fix git wrapper * fallback to bin/sh * Use percent formatting as per sivel's review --- lib/ansible/modules/source_control/git.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index 5a73b3873f6..954fab15b3b 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -371,9 +371,10 @@ fi def set_git_ssh(ssh_wrapper, key_file, ssh_opts): - if os.environ.get("GIT_SSH"): - del os.environ["GIT_SSH"] + # git_ssh_command will override git_ssh, so only older git needs it os.environ["GIT_SSH"] = ssh_wrapper + # using shell to avoid 'noexec' issues if module temp dir is located in such a mount + os.environ["GIT_SSH_COMMAND"] = '%s %s' % (os.environ.get('SHELL', '/bin/sh'), ssh_wrapper) if os.environ.get("GIT_KEY"): del os.environ["GIT_KEY"]