Permission denied while doing git clone when deploying

When deploying to my shared webhosting, the git clone process is failing because of a permission error on the /tmp/ directory. Presumably there is a noexec set which gives the permission error. Is there a way to use a path other than /tmp/ ? For example ~/tmp/

See output below for details.

TASK [deploy : Clone project files] ********************************************
task path: /Users/solting/Sites/qiblainnovation.nl/trellis/roles/deploy/tasks/update.yml:24
<ssh085059.bytenet.nl> ESTABLISH SSH CONNECTION FOR USER: qiblainnovation.nl
<ssh085059.bytenet.nl> SSH: EXEC ssh -C -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=qiblainnovation.nl -o ConnectTimeout=10 -o ControlPath=/Users/solting/.ansible/cp/ansible-ssh-%h-%p-%r ssh085059.bytenet.nl '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1480979319.8-261656831054202 `" && echo ansible-tmp-1480979319.8-261656831054202="` echo $HOME/.ansible/tmp/ansible-tmp-1480979319.8-261656831054202 `" ) && sleep 0'"'"''
<ssh085059.bytenet.nl> PUT /var/folders/j3/3640zn1543j7y2wnf8xm1z6w0000gp/T/tmp4A9uMA TO /home/users/qiblaftp/.ansible/tmp/ansible-tmp-1480979319.8-261656831054202/git
<ssh085059.bytenet.nl> SSH: EXEC sftp -b - -C -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=qiblainnovation.nl -o ConnectTimeout=10 -o ControlPath=/Users/solting/.ansible/cp/ansible-ssh-%h-%p-%r '[ssh085059.bytenet.nl]'
<ssh085059.bytenet.nl> ESTABLISH SSH CONNECTION FOR USER: qiblainnovation.nl
<ssh085059.bytenet.nl> SSH: EXEC ssh -C -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=qiblainnovation.nl -o ConnectTimeout=10 -o ControlPath=/Users/solting/.ansible/cp/ansible-ssh-%h-%p-%r ssh085059.bytenet.nl '/bin/sh -c '"'"'chmod u+x /home/users/qiblaftp/.ansible/tmp/ansible-tmp-1480979319.8-261656831054202/ /home/users/qiblaftp/.ansible/tmp/ansible-tmp-1480979319.8-261656831054202/git && sleep 0'"'"''
<ssh085059.bytenet.nl> ESTABLISH SSH CONNECTION FOR USER: qiblainnovation.nl
<ssh085059.bytenet.nl> SSH: EXEC ssh -C -vvv -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=qiblainnovation.nl -o ConnectTimeout=10 -o ControlPath=/Users/solting/.ansible/cp/ansible-ssh-%h-%p-%r -tt ssh085059.bytenet.nl '/bin/sh -c '"'"'LANG=nl_NL.UTF-8 LC_ALL=nl_NL.UTF-8 LC_MESSAGES=nl_NL.UTF-8 /usr/bin/python /home/users/qiblaftp/.ansible/tmp/ansible-tmp-1480979319.8-261656831054202/git; rm -rf "/home/users/qiblaftp/.ansible/tmp/ansible-tmp-1480979319.8-261656831054202/" > /dev/null 2>&1 && sleep 0'"'"''
System info:
  Ansible 2.1.2.0; Darwin
  Trellis at "Fix 404s by moving skip_cache conditions to server block"
---------------------------------------------------
fatal: cannot exec '/tmp/tmp3Kjh3B': Permission denied
fatal: unable to fork
fatal: cannot exec '/tmp/tmp3Kjh3B': Permission denied
fatal: unable to fork

fatal: [ssh085059.bytenet.nl]: FAILED! => {"changed": false, "cmd": "/usr/bin/git ls-remote '' -h refs/heads/develop", "failed": true, "invocation": {"module_args": {"accept_hostkey": false, "bare": false, "clone": true, "depth": null, "dest": "/home/users/qiblaftp/qiblainnovation.nl/shared/source", "executable": null, "force": false, "key_file": "/home/users/qiblaftp/.ssh/id_rsa", "recursive": true, "reference": null, "refspec": null, "remote": "origin", "repo": "git@gitlab.solting.nl:sites/qiblainnovation.nl.git", "ssh_opts": null, "track_submodules": false, "update": true, "verify_commit": false, "version": "develop"}, "module_name": "git"}, "rc": 128, "stdout": "", "stdout_lines": []}

I’m not exactly sure what’s going on here. The debugging output before the error mentions a path of $HOME/.ansible/tmp/.

Ansible does have a view tmp path settings:

Nothing in our deploys specifically use /tmp so maybe it’s that.

1 Like