i have the necessity to copy a large number of file in a large number of server and to check periodically
now i use a task like this
- name: Synchronization of src on the control machine to dest on the remote hosts usr/lib/nagios/plugins
copy: src={{ item }} dest=/usr/lib/nagios/plugins/ mode=0755
with_fileglob:
- plugins/*
but take a lot of time (70 file) x 200 server
i have an maven it’s a good idea to create a zip with all the file and manage like a single entities ?
Since you appear to be copying everything in a directory you could benefit from using the synchronize module, and also specify a single directory as source, instead of iterating over the items in a glob pattern.
This should speed things up significantly.
Dick
thank you!
but all the file in in a repository,
for you is not better to create a zip a use like an artifcat over nexus or jfrog?
to speed up push & post
I have no idea what you mean by 'all the file in in a repository'. If
you mean the source of the module, then I don't see how this is
relevant?
Also artifcat, nexus, or jfrog don't mean anything to me (neither do
push & post, in this context).
Your task is about synchronizing a number of nagios plugins in a local
source directory to a destination directory on your target system.
As for the hint about 'a zip', then I assume you are asking if
combining individual files into a single archive file would be better.
This of course depends on what your definition of 'better' is.
Assuming it includes 'easier to manage', then the answer is no.
You add a lot of overhead by having to handle the creation and
unwrapping of the ZIP file.
It will hence be more work to achieve idempotency (depending if this
is part of your definition of 'better', but I think it should).
So I would still go for the 'synchronize' module (note that your
original task actually had that very word in it's name).
If your scale requires further optimisations, then I would suggest to
do some tests using different strategies and compare numbers.
Dick