So, what's the deal with action_plugins? There is very little documentation 
on their purpose.

Observations:
1. If action_plugin/foo.py and library/foo.py both exist, then only 
action_plugin/foo.py gets called (the plugin *may* call the module if it 
wants, but that is not by default).
2. If library/foo.py exists, but there is no corresponding action_plugin, 
the library is called.
3. If action_plugin/foo.py exists, but there is no corresponding module, 
then Ansible throws a syntax error.
4. If action_plugin/foo.py exists, and the library is empty (literally 
created with 'touch library/foo.py'), then the action_plugin is called and 
everything works.
5. *some*times, but no always, the action_plugin does some preliminary work 
with data that is not available to the library or the option plugin 
modifies the results.

For #5, I can understand a solid use case. If a vendor supplies a module 
and you want to use it, but would prefer to have the data returned 
differently (or strip out data or whatever) but don't want to modify the 
vendor's module, then this makes a lot of sense as a module wrapper.

I need to write a module and can't decide if I should write a standard 
library module or if I should write an action_plugin with a blank library 
module (I suppose just to use for documentation, though that seems odd).

any clarification would help.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/17700444-9aa5-42de-a3f4-c023fb05741c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to