Sorry, I don't understand what "useless information is", you will need to
be more specific.

I also don't understand the set_fact part of the above commentary, or what
you wanted it to work like when you say it didn't work like you wanted to.

The synchronize module is available if you'd like a nice wrapper around
rsync, though I'm not clear on what you want to do that it does not provide.

Let me know.

Thanks!


On Thu, Sep 4, 2014 at 11:19 AM, Patrick D <[email protected]> wrote:

> All I wanted to do was to fetch files for OTAP purposes. Well ....
>
> I tried fetch, combining it with copying files to a backup folder and
> using fdupes (not installed by default). But i needed the backup files to
> include a timestamp. Well you can imagine my playbook grew and grew with
> set_facts and what not (i did not give up without a fight). The playbook
> filled my screen with useless information and on top of it all, it did not
> work like i wanted it to.
>
> So i resorted to back to old trusty rsync and now have a nice simple
> single task in my playbook
> - How are others implementing this?
> - Anything missing by any change?
>
> vars:
>   files_to_sync:
>     - file1
>     - file2
>   fetchfiles: /root/ansible/fetchfiles
>
> tasks:
>   - name: sync file to master
>     local_action: shell rsync -abci --backup-dir=backup --suffix=_`date
> '+%Y%m%d.%H%M%S'` {{ ansible_user_id }}@{{ ansible_fqdn }}:'{{
> files_to_sync | join(' ') }}' {{ fetchfiles }}/{{ inventory_hostname }}
>     register: mastersync
>     changed_when: mastersync.stdout
>
> i use the -c option of rsync, because i dump sql tables to temporary
> files, so the timestamp does get changed
> the -i option to itemize changes to report actual changes
>
>
>  --
> 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/707308e9-18aa-4648-ad9b-52ac4b299e08%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/707308e9-18aa-4648-ad9b-52ac4b299e08%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%2BnsWgwVgBJGBysNPVQKzYTkuB%3DHSDtxH6k6nwmn5kEEGy5YDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to