ANSIBLE.COPY(3)

NAME
copy - Copies files to remote locations.

DESCRIPTION

The copy module copies a file on the local box to remote locations.

OPTIONS

backup
    Create a backup file including the timestamp information so you can get the original file back if you somehow clobbered it incorrectly. Choices: yes,no. (default: no)(Added in Ansible version 0.7.)

content
    When used instead of 'src', sets the contents of a file directly to the specified value.(Added in Ansible version 1.1.)

dest
    Remote absolute path where the file should be copied to.(required)

force
    the default is yes, which will replace the remote file when contents are different than the source. If no, the file will only be transferred if the destination does not exist. Choices: yes,no. (default: yes)(Added in Ansible version 1.1.)

others
    all arguments accepted by the file module also work here

src Local path to a file to copy to the remote server; can be absolute or relative.."

NOTES

The "copy" module can't be used to recursively copy directory structures to the target machine. Please see the "Delegation" section of the Advanced Playbooks documentation for a better approach to recursive copies.

EXAMPLES

Example from Ansible Playbooks
copy: src=/srv/myfiles/foo.conf dest=/etc/foo.conf owner=foo group=foo mode=0644

Copy a new ntp.conf file into place, backing up the original if it differs from the copied version
copy: src=/mine/ntp.conf dest=/etc/ntp.conf owner=root group=root mode=644 backup=yes
None

AUTHOR
Michael DeHaan

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#copy