I’d like to write a “patch” module that copies over a patch file and runs (idempotenetly) runs the patch program.
How do I copy a local file to the remote machine inside an ansible module?
Lorin
I’d like to write a “patch” module that copies over a patch file and runs (idempotenetly) runs the patch program.
How do I copy a local file to the remote machine inside an ansible module?
Lorin
You would have to do something like the 'copy' module where there is
both a local and remote plugin component.
As this mostly just needs the functionality of the copy plugin, it
might be nice to just find a way to put some metadata in the module
itself that lets it transfer src to dest via
copy before running (i.e. some modification to runner.py).
If that is done, a good way to test would be to implement copy.py
(modify it) to allow the remote module to work exactly like this.
Until then, you would just need the two stage process and require the
path module to take a local path.
s/path/patch/
Hi Lorin, did you ever write a patch module or modify the file module
as suggested by Michael? I for one would find this useful.
Hi Yang:
No, I’m afraid not, unfortunately other stuff has been keeping me busy. Not sure when I’ll have a chance at this.
Take care,
Lorin
Hello,
Some months ago i wrote a small patch module. However it assumes that the patch file is already uploaded to the remote machine. I didn’t have the time to improve it. You can find it here:
https://github.com/luisperlaz/ansible-misc-modules/blob/master/patch
Luis
nice, this is/was on my list, mind if i expand it to be able to copy the file from ‘master’ ?