Ansible – Copy file from node to remote

You will find in the next days several posts with specific Ansible playbook for usual use case.

The first post is to show how to copy a file or a folder from the node (nodeA) where you are running the Ansible playbook and a remote node (nodeB)

---
- name: Copy file
  hosts: myRemoteNode
  tasks:
  - name: Copy file from the Ansible server to myRemoteNode
    copy:
      # file and location path on the Ansible server
      src: /mylocalpath/file
      # file and location path on myRemoteNode
      dest: /dest/renamed.file

Ansible – Copy a file to a remote node

Leave a Reply

Your email address will not be published.