I have two questions about action_plugins:
- 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
- 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.