Action Plugins and Async Support

I have two questions about action_plugins:

  1. I wrote a custom ansible module that by default has async support. I wrote an action plugin for it like below. Now I get error - async mode is not supported for this module. Anything else I should be doing to support this?
class ActionModule(ActionBase):

    def run(self, tmp=None, task_vars=None):
        print("Hi from action plugin")

        result = super(ActionModule, self).run(tmp, task_vars)

        killFlag = os.getenv('KILL_FLAG')

        print("Kill Flag = %s" % killFlag)

        if killFlag == "KILL_JOB":
            result['skipped'] = True
            result['msg'] = 'Skipped from action plugin due to Stop Request'
        else:
            result.update(self._execute_module())

        print("Bye from action plugin")

        return result
  1. Can we have a global action plugin or something similar to check a variable and skip all remaining tasks in the Ansible execution?

Appreciate any advise on a better way to accomplish gracefully stopping the playbook execution.

So async was handled by using a specific 'async' action plugin up to
and including version 2.2, this precluded action plugins from being
compatible with async (as this required a specific one)

In 2.3 we have changed how this works so it happens when you call
execute_module, for the action plugin you just need to add a property
`self._supports_async = True` and then deal with running the
module with the async setting (see service/package for examples).

As for the 'skip' module/action, there has been that feature request
for a while, currently we only have the ability to 'fail' using that
module or 'assert', a workaround is using a block with conditionals to
apply to the 'rest of the tasks' in the play.