diff --git a/plugins/action/k8s_info.py b/plugins/action/k8s_info.py index 181daca4e6..9f7dbf1555 100644 --- a/plugins/action/k8s_info.py +++ b/plugins/action/k8s_info.py @@ -332,6 +332,7 @@ def get_kubeconfig(self, kubeconfig, remote_transport, new_module_args): def run(self, tmp=None, task_vars=None): """handler for k8s options""" + self._supports_async = True if task_vars is None: task_vars = dict() @@ -364,7 +365,7 @@ def run(self, tmp=None, task_vars=None): # src is on remote node result.update( self._execute_module( - module_name=self._task.action, task_vars=task_vars + module_name=self._task.action, task_vars=task_vars, wrap_async=self._task.async_val ) ) return self._ensure_invocation(result) @@ -396,10 +397,12 @@ def run(self, tmp=None, task_vars=None): module_name=self._task.action, module_args=new_module_args, task_vars=task_vars, + wrap_async=self._task.async_val ) # Delete tmp path - self._remove_tmp_path(self._connection._shell.tmpdir) + if not self._task.async_val: + self._remove_tmp_path(self._connection._shell.tmpdir) result.update(module_return)