(developers) 0.8 feature preview, modularized server actions in Runner code

Of possible interest to Ansible developers, a bit of a preview of an upcoming small code tweak.

This coming for 0.8, which is not officially available as a branch as I haven't released 0.7 just yet.

Basically this makes server-side action code (like the mechanisms behind file transfer and templating, which lurk beyond the basic "this module is just a Python" file logic) user extensible via plugins. This means that if you wanted to write a module that interacted with your local Ansible server a bit before running (and after it got a result), it's really easy to do now as well.

It's not done, but you may find it interesting and I wanted to point it out:

https://github.com/mpdehaan/ansible/tree/modular_runner/lib/ansible/runner/action_plugins

An example of why you might need this? Not too many I can think of. We're going to have a "pause" module in 0.8 that will allow you to prompt in between playbook batches that will use this -- and we'll have a way to indicate that this should happen outside the forking/multiple loop too -- so there can be different types of these modules. This might also be a good fit for something crazy like an SNMP action where the general idiom of a "connection module" didn't quite make sense. If we wanted to do something with an rsync push making syntactic sugar for that better, this would probably be a good place to do it. If we wanted to do something to integrate with something like murder (does that even make sense?), maybe this would be a good place to do it. Think up some good uses!

In general, we don't want to have a lot of these, as if something is happening on the remote machine, it is just a regular Ansible module -- but this is how you write new *server side* module underpinnings. If you are familiar with Func, this is basically "overlord side modules", no more, no less.

If things happen only on the remote machine, it's still an ansible module. If it's notification that something happened, it's still a callback plugin. If you want to execute modules over a transport, that is still a connection plugin. This is kind of the weird corner for things that aren't any of those things -- they are about the low level glue that makes the whole thing tick.

So yeah, whether a lot of action plugins get written -- or it's just a refactoring -- remains to be seen. But the point is, yes, you will be able to write your own.

The main benefit is it makes the Runner code a lot shorter -- and something that has to change a lot less too.

--Michael