ssh keys

i trying run ansible command on new server which i didn’t copied my public ssh keys, i want to try talking to that remote linux using ssh user name and passwd and also with providing ssh-private keys to talk to instantly with out passwd, below is the script i written and error i am getting not sure where i am doing wrong

[ansible@centos2 playbook]$ cat first.yml
— # try ubuntu1
- hosts: ubuntu1.ohari.com
connection: ssh
remote_user: ansible
vars_files:
- values.property

tasks:
- name: check dir
shell: ls -ltr /var/tmp
register: result
- debug: var=result

[ansible@centos2 playbook]$ cat values.property
ansible_ssh_private_key_file: ~/.ssh/id_rsa
ansible_ssh_pass: papakaka
[ansible@centos2 playbook]$

[ansible@centos2 playbook]$ ansible-playbook first.yml

PLAY [ubuntu1.ohari.com] *******************************************************

TASK [setup] *******************************************************************
fatal: [ubuntu1.ohari.com]: UNREACHABLE! => {“changed”: false, “msg”: “Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: ( umask 77 && mkdir -p "echo $HOME/.ansible/tmp/ansible-tmp-1485212780.65-250431407683253" && echo ansible-tmp-1485212780.65-250431407683253="echo $HOME/.ansible/tmp/ansible-tmp-1485212780.65-250431407683253" ), exited with result 1”, “unreachable”: true}
to retry, use: --limit @/home/ansible/playbook/first.retry

PLAY RECAP *********************************************************************
ubuntu1.ohari.com : ok=0 changed=0 unreachable=1 failed=0

[ansible@centos2 playbook]$

Thank you very much for your help, it is really appreciated.

It’s working now, after updated the /etc/ansible/ansible.cfg file with below values
from
remote_tmp = $HOME/.ansible/tmp

to
remote_tmp = /tmp/.ansible/tmp

Jithendra