Update the FAQ advice on recursive copy now that there are two good ways to do this.
This commit is contained in:
parent
e639b5382b
commit
ba79cf34df
1 changed files with 1 additions and 11 deletions
|
@ -179,17 +179,7 @@ Notice how we interchanged the bracket syntax for dots -- that can be done anywh
|
||||||
How do I copy files recursively onto a target host?
|
How do I copy files recursively onto a target host?
|
||||||
+++++++++++++++++++++++++++++++++++++++++++++++++++
|
+++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
The "copy" module doesn't handle recursive copies of directories. A common solution to do this is to use a local action to call 'rsync' to recursively copy files to the managed servers.
|
The "copy" module has a recursive parameter, though if you want to do something more efficient for a large number of files, take a look at the "synchronize" module instead, which wraps rsync. See the module index for info on both of these modules.
|
||||||
|
|
||||||
Here is an example::
|
|
||||||
|
|
||||||
---
|
|
||||||
# ...
|
|
||||||
tasks:
|
|
||||||
- name: recursively copy files from management server to target
|
|
||||||
local_action: command rsync -a /path/to/files $inventory_hostname:/path/to/target/
|
|
||||||
|
|
||||||
Note that you'll need passphrase-less SSH or ssh-agent set up to let rsync copy without prompting for a passphrase or password.
|
|
||||||
|
|
||||||
.. _shell_env:
|
.. _shell_env:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue