permissions - Run playbook on servers with shared NFS mount -
i have following ansible playbook package updates across cluster:
- hosts: cluster become: true become_user: root tasks: - name: updates server apt: update_cache=yes - name: upgrade server apt: upgrade=full
when run it, node nfs controller executes fine, 2 nodes have nfs mount on home directory fails following error:
$ansible-playbook upgrade-servers.yml -k sudo password: play *************************************************************************** task [setup] ******************************************************************* fatal: [nej-worker2]: failed! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "\r\n/usr/bin/python: can't open file '/home/gms/.ansible/tmp/ansible-tmp-1461269057.4-144211747884693/setup': [errno 13] permission denied\r\n", "msg": "module failure", "parsed": false} ok: [iznej] fatal: [nej-worker1]: failed! => {"changed": false, "failed": true, "module_stderr": "", "module_stdout": "\r\n/usr/bin/python: can't open file '/home/gms/.ansible/tmp/ansible-tmp-1461269057.4-16590584976890/setup': [errno 13] permission denied\r\n", "msg": "module failure", "parsed": false} task [updates server] ******************************************************** ok: [iznej] task [upgrade server] ******************************************************** changed: [iznej] no more hosts left ************************************************************* play recap ********************************************************************* iznej : ok=3 changed=1 unreachable=0 failed=0 nej-worker1 : ok=0 changed=0 unreachable=0 failed=1 nej-worker2 : ok=0 changed=0 unreachable=0 failed=1
i've had similar issues running pip
on shares, fix being redirect build directory using --set-build
... assuming problem ansible, since working on nfs controller , not ones servers shared/mounted drive.
got it. needed add remote_tmp = /tmp/.ansible ansible.cfg file. see here ansible config parameters voila!
the issue when ansible executes sudo, root account not user account on nfs mounted shares.
Comments
Post a Comment