mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-07 02:10:23 +00:00
feat: 优化代码结构,receptor开关,修改为 tcp 通信 (#13078)
* feat: 优化代码结构,receptor开关,修改为 tcp 通信 * fix: 修改导包路径 * fix: 修复错别字 * fix: 修改导包路径 * perf: 优化代码 * fix: 修复任务不执行的问题 * perf: 优化配置项名称 * perf: 优化代码结构 * perf: 优化代码 --------- Co-authored-by: Aaron3S <chenyang@fit2cloud.com>
This commit is contained in:
24
apps/ops/ansible/runners/native.py
Normal file
24
apps/ops/ansible/runners/native.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import ansible_runner
|
||||
|
||||
from libs.process.ssh import kill_ansible_ssh_process
|
||||
from ops.ansible.cleaner import cleanup_post_run
|
||||
from ops.ansible.runners.base import BaseRunner
|
||||
|
||||
__all__ = ['AnsibleNativeRunner']
|
||||
|
||||
|
||||
class AnsibleNativeRunner(BaseRunner):
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
|
||||
@classmethod
|
||||
def kill_precess(cls, pid):
|
||||
return kill_ansible_ssh_process(pid)
|
||||
|
||||
@cleanup_post_run
|
||||
def run(self):
|
||||
ansible_runner.run(
|
||||
event_handler=self.get_event_handler(),
|
||||
status_handler=self.get_status_handler(),
|
||||
**self.runner_params,
|
||||
)
|
Reference in New Issue
Block a user