```json
fatal: [example.com]: FAILED! => {
"failed": true,
"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: OpenSSH_7.4p1, LibreSSL 2.5.0\r\ndebug1: Reading configuration data /Users/username/.ssh/config\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 81953\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\nchown: changing ownership of '/tmp/ansible-tmp-1515268463.91-198282885552037/': Operation not permitted\nchown: changing ownership of '/tmp/ansible-tmp-1515268463.91-198282885552037/source': Operation not permitted\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\n}). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"
}
```
This can be fixed by replacing the copy operation with a lineinfile operation without causing any problems that I can see. Pull request forthcoming shortly to demonstrate.
While trying to use Deploy to deploy to a server where the Ansible ssh user does not have sudo, the role will fail on the REVISION copy operation in
update-code.yml
:This can be fixed by replacing the copy operation with a
lineinfile
operation without causing any problems that I can see. Pull request forthcoming shortly to demonstrate.