>From the synchronize docs, here's an example of how to make it synchronize
to your central host:

# Synchronization of src on delegate host to dest on the current inventory host
synchronize: >
    src=some/relative/path dest=/some/absolute/path
    delegate_to: delegate.host

In this case, "delegate_to: localhost" or equivalent.





On Fri, Sep 5, 2014 at 3:44 AM, Patrick D <[email protected]> wrote:

> Sorry let me elaborate :)
>
> I had a playbook that did:
> - setfact to create a datetimestamp to add to my filename
> - stat remote file
> - stat local file
> - rename local file if remote.md5 != localfile.md5
> - fetch the remotefile
>
> So for each file i would get 5 tasks, each 4-5 lines, scrolling over my
> screen, creating somewhat of a mess. Especially since i want to fetch 20+
> files. The reason i abandoned this path is because i couldn't include the
> playbook using with_items (deprecated feature) and i didn't feel like
> rewriting my playbook because of the number of tasks getting repeated for
> each file. It was a fun exercise though, getting to know the nooks and
> crannies of ansible.
>
> Back to my usecase. Normally ansible works by pushing files to a "slave"
> and the copy module has a backup argument, however for OTAP purposes i want
> to import data from one server and push it to another and let the ansible
> master machine work out the details when pushing configs and data to a new
> testmachine.
> So i needed the fetch module, but with a backup argument, which it doesn't
> have.
>
> Synchronize is a nice module, but works like copy, pushing from the
> control machine to remote host. I wanted it in reverse
> local_action: synchronize works the sync two paths on the control machine,
> according to the samples given.
>
> So there you have it :) both synchronize usecases and the fetch module
> didn't cover my usecase.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/99f412b2-657a-4d91-b181-a8e5a7169d4d%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/99f412b2-657a-4d91-b181-a8e5a7169d4d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgybVfAstmADnNv8-VBGTpeaC%3DtGD0x6VZ9F-Yj%2BX_s7bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to