you can use the 'find' module to select the files to be deleted, I have a
'tidy' role as an example: https://galaxy.ansible.com/bcoca/tidy/

On Tue, Apr 12, 2016 at 2:19 PM, Johannes Kastl <[email protected]> wrote:

> Hi all,
>
> excuse the subject, I'll try to explain:
>
> I can tell ansible to delete all files from a certain directory, at
> least I guess I can...
>
> But can I tell it to exclude certain files?
>
> I know I could use the synchronize module, which seems to be rsync in
> disguise. But it seems a bit ugly, to keep around a lot of different
> directories for all different hosts, where there are different files
> in the directory.
>
> Also, using file module to delete the directory and then populating it
> with file or template would report 'changed' each time.
>
> Any hints?
>
> Johannes
>
> --
> 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/570D3C34.6070106%40ojkastl.de
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
----------
Brian Coca

-- 
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/CACVha7c9tWCMbQng0SaQKnKQg6bTpmOyxQjHfQwH-x-foizuYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to