diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index b98ab249e39..828017ecd64 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -660,7 +660,7 @@ def verify_commit_sign(git_path, module, dest, version): def main(): module = AnsibleModule( argument_spec = dict( - dest=dict(), + dest=dict(type='path'), repo=dict(required=True, aliases=['name']), version=dict(default='HEAD'), remote=dict(default='origin'), @@ -672,9 +672,9 @@ def main(): update=dict(default='yes', type='bool'), verify_commit=dict(default='no', type='bool'), accept_hostkey=dict(default='no', type='bool'), - key_file=dict(default=None, required=False), + key_file=dict(default=None, type='path', required=False), ssh_opts=dict(default=None, required=False), - executable=dict(default=None), + executable=dict(default=None, type='path'), bare=dict(default='no', type='bool'), recursive=dict(default='yes', type='bool'), track_submodules=dict(default='no', type='bool'), @@ -706,16 +706,11 @@ def main(): if not dest and allow_clone: module.fail_json(msg="the destination directory must be specified unless clone=no") elif dest: - dest = os.path.abspath(os.path.expanduser(dest)) if bare: gitconfig = os.path.join(dest, 'config') 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