Hi All,
I’m looking for some help in desiging my playbook (as a relative n00b, I’m getting overwhealmed by the possibilities of how to go about solving me issue).
I’m also trying to avoid fallling into the XY Problem.
My Issue:
I need to copy a given directory structure and the accompanying files within that structure from my_src
to my_dest
. However, there are some files (and folders) scattered about within this directory structure that are not required/wanted. Fortunately, all of these unrequired files can be easily identified because they all begin with the characters _
or Q_
(it is also relatively easy, at this point in time, to substitute different character strings for those given if those character combinations do/will cause problems). Likewise the unrequired folders are also easily identifiable.
For the record, all of these files are simple text files (ie these are no “executable” files) but they do have a variety of file extensions (ie .txt
, .md
, .sc
, etc).
This is all on linux-based source and destination.
I’ve looked at using ansible.posix.synchronize
but have ruled it out due to the requirement of having rsync
installed: something that is not possible.
I think using ansible.builtin.copy
is the way to do things, and I know how to do the recursive directory copy, etc, with that module, buy I’m not sure how to do the file/folder “exclusion” part.
So could someone help me out, please? Or if there’s a different solution then could you let me know - thanks.
Cheers
Dulux-Oz