I'm trying to clone a remote repository by Ansible using the git module. Here's the task configuration:
- name: Clone repo
git:
repo: "{{ repository }}"
dest: "/home/{{ username }}/abc"
key_file: "{{ git_key_file }}"
register: code_update
But unfortunately it fails with below error:
fatal: [xyz]: FAILED! => {"changed": false, "cmd": "/usr/bin/git clone --origin origin '' /home/xyz/abc", "msg": "Cloning into '/home/xyz/abc'...\nfatal: cannot exec '/tmp/tmpm9mfdkci': Permission denied\nfatal: cannot exec '/tmp/tmpm9mfdkci': Permission denied\nfatal: unable to fork", "rc": 128, "stderr": "Cloning into '/home/xyz/abc'...\nfatal: cannot exec '/tmp/tmpm9mfdkci': Permission denied\nfatal: cannot exec '/tmp/tmpm9mfdkci': Permission denied\nfatal: unable to fork\n", "stderr_lines": ["Cloning into '/home/xyz/abc'...", "fatal: cannot exec '/tmp/tmpm9mfdkci': Permission denied", "fatal: cannot exec '/tmp/tmpm9mfdkci': Permission denied", "fatal: unable to fork"], "stdout": "", "stdout_lines": []}
It is worth mentioning that I can clone repository directly on remote server. Also I tried to change the TMP and TMPDIR using environment setting but nothing changed.
Any response would be appreciated...