fix: 修复 ansible receptor playbook 无法执行的问题

This commit is contained in:
Aaron3S
2024-04-10 18:14:49 +08:00
committed by Bryan
parent 3e46d72ba3
commit 2b05fd5276
4 changed files with 15 additions and 4 deletions

View File

@@ -339,7 +339,9 @@ class JobExecution(JMSOrgBaseModel):
)
elif self.current_job.type == Types.playbook:
runner = PlaybookRunner(
self.inventory_path, self.current_job.playbook.entry
self.inventory_path,
self.current_job.playbook.entry,
self.private_dir
)
elif self.current_job.type == Types.upload_file:
job_id = self.current_job.id
@@ -522,7 +524,6 @@ class JobExecution(JMSOrgBaseModel):
ssh_tunnel.local_gateway_clean(runner)
def stop(self):
unit_id_path = os.path.join(self.private_dir, "local.unitid")
if os.path.exists(unit_id_path):
with open(unit_id_path) as f: