From c52bfe3e35ef6a50b16be77ed7a50bcf3c69596d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Tue, 30 Sep 2014 23:04:54 -0400 Subject: [PATCH] Fix #91: Expand user home folder for the key_file path of the git module --- lib/ansible/modules/source_control/git.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index b44d9f2c196..ce81088057e 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -625,6 +625,10 @@ def main(): else: gitconfig = os.path.join(dest, '.git', 'config') + # make sure the key_file path is expanded for ~ and $HOME + if key_file is not None: + key_file = os.path.abspath(os.path.expanduser(key_file)) + # create a wrapper script and export # GIT_SSH= as an environment variable # for git to use the wrapper script