ansiblecopy

how to copy directories from remote machines to localhost?


In ansible playbook, fetch module only copies file from target machine to local. copy/synchronize modules can copy directories/files from local to target machine.

Then how to copy direcotries from remote target machines


Solution

  • Acording to ducumentation : synchronize – A wrapper around rsync

    mode(string) Choices: {pull,push}

    Specify the direction of the synchronization.

    In push mode the localhost or delegate is the source.

    In pull mode the remote host in context is the source.