mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-24 22:12:00 +00:00
Merge pull request #9999 from jumpserver/pr@dev@perf_ansible_config
perf: 优化 ansible 写法
This commit is contained in:
commit
074c9c85b1
@ -49,12 +49,12 @@ class JMSInventory:
|
|||||||
|
|
||||||
if gateway.password:
|
if gateway.password:
|
||||||
proxy_command_list.insert(
|
proxy_command_list.insert(
|
||||||
0, "sshpass -p '{}'".format(gateway.password)
|
0, "sshpass -p {}".format(gateway.password)
|
||||||
)
|
)
|
||||||
if gateway.private_key:
|
if gateway.private_key:
|
||||||
proxy_command_list.append("-i {}".format(gateway.private_key_path))
|
proxy_command_list.append("-i {}".format(gateway.private_key_path))
|
||||||
|
|
||||||
proxy_command = '-o ProxyCommand=\"{}\"'.format(
|
proxy_command = "-o ProxyCommand='{}'".format(
|
||||||
" ".join(proxy_command_list)
|
" ".join(proxy_command_list)
|
||||||
)
|
)
|
||||||
return {"ansible_ssh_common_args": proxy_command}
|
return {"ansible_ssh_common_args": proxy_command}
|
||||||
|
Loading…
Reference in New Issue
Block a user