connection: local and delegate_to not working together

46 views
Skip to first unread message

Jegan A

unread,
Aug 18, 2020, 9:40:54 AM8/18/20
to Ansible Project
Hello Team,

I am facing issue while running below playbook from ansible  server. Getting error like below.  I gave small part of the playbook. The intention to use connection: local is I like to perform few tasks from ansible server and like to perform few task on remote server. Which task I like to perform remote server there am using delegate_to action. It was working fine in anisble 2.9.9 version. After upgraded ansible to 2.9.10 am facing this issue. Not sure it is bug in latest version. Could you please help on this issue. Thanks in advance.


TASK [Copy script to remote server] ***********************************************************************************************
fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /home/ansible/.ansible/tmp `\"&& mkdir /home/ansible/.ansible/tmp/ansible-tmp-1597756123.06-13139-115650747168755 && echo ansible-tmp-1597756123.06-13139-115650747168755=\"` echo /home/ansible/.ansible/tmp/ansible-tmp-1597756123.06-13139-115650747168755 `\" ), exited with result 1", "unreachable": true}

---
- name : Playbook test
  hosts: localhost
  connection: local
  become_method: sudo

  tasks:
    - name: Copy script to remote server
      copy:
       src:  /oci-playbooks/DBRefresh/files/removedisks.sh
       dest: /home/ansible/
      become: yes
      delegate_to: 192.168.1.2

Reply all
Reply to author
Forward
0 new messages