Bootstrap FreeKB - Ansible - remote_src parameter
Ansible - remote_src parameter

Updated:   |  Ansible articles

By default, some modules will be run on the control node (that's your Ansible server). For example, the default behavior of the copy module is to copy a file or directory from the control node (that's your Ansible server) to the managed nodes (e.g. target systems). The remote_src parameter can be used to perform the task on the managed node (the target system). In this example, the /root/foo.txt file on the managed node will be copied to /tmp/foo.txt on the managed node.

- hosts: all
  - name: copy /root/foo.txt to /tmp/foo.txt
      src: /root/foo.txt
      dest: /tmp/foo.txt
    remote_src: true


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

Please enter d41ded in the box below so that we can be sure you are a human.