I’m currently developing a fairly involved action_plugin (which ideally would be shipped with a role, but could also be added to the appropriate path in ansible.cfg), and it seems there are a few limitations.
is it possible for action_plugins and modules to share some code? I’d like to re-use the same constants that is used in an action_plugin in an (unrelated) module.
is it possible to execute some sort of task-list from an action_plugin? I’ve tried all of import_tasks, include_tasks, import_role and include_role, but none of them seem to work, probably due to their ‘special’ non-module nature. I’m not too optimistic that there is something I can do, but maybe somebody on here can think of a workaround?
In a pinch I guess I can just execute the task-lists from a playbook using conditionals, but that’s going to be ugly, and ideally I’d like to just hide everything that is going on from the user.
Even if that code is in a module_utils folder within a role? I tried that but couldn’t get it to work. That might have very well been my own fault though, will try again…
no, only strategy plugins deal with task lists, action plugins
execute ONE action but cannot modify the list of tasks for the play.
Ok, thanks for the confirmation. Much appreciated.