Hello,
regarding the number of ssh roundrips, ssh_alt lowers them down for all modules that do not need files transfered (eg template, copy)
the overall principle of the execution path of a module is
- module = render(module, data) # all ‘new’ modules work this way
- cat module | ssh -c python
when there are several files to send you cannot do this.
but as you may know, python since 2.6 knows how to execute zip archives (egg are zip archives)
so you could imagine that a zip file is prepared will all python files necessary, all ressources and this file is send over the network.
on the principle a sort of
- module.egg = render(module, data)
- cat module.egg | ssh -c python
the problem is that this does not work because “python module.egg” works but not “cat module.egg | python”. I did some research on this that you can read here http://stackoverflow.com/questions/20276105/why-cant-python-execute-a-zip-archive-passed-via-stdin
(you can give some points to the guy who answered this thread he deserves it
with his solution, considering that one “bootstrap.py” file is sent to a remote at the beginning of a play, then you can do
- module.egg = render(module, data)
- cat module.egg | ssh -c python bootstrap.py
=> many more operations can be done with 1 ssh roundrip
=> full python archives can be sent simplifying the rendering of the modules (no need to template the data inside the module for example).
=> modules could be more easily decomposed into building blocks
Just sending this in case it gives you some ideas & in order that the stack overflow answer does not get lost.
As the guy said :
" but I cannot imagine any engineer thinking that it would be a good solution for how to handle code updates or remote control."
so i guess I am totally assuming the role of the engineer here