ansible - ansible - 使用跳转主机时在横幅交换期间连接超时
问题描述
ansible 命令:ansible all -m ping -i host.yml
这是我的 host.yml
---
all:
hosts:
tencent:
ansible_user: "ubuntu"
ansible_host: "106.55.XXX.XXX"
ansible_ssh_private_key_file: "key.pem"
ansible_ssh_common_args: 'ssh -o ProxyCommand="ssh -i bastion.key.pem ubuntu@102.106.XXX.XXX"'
错误信息:
Failed to connect to the host via ssh: Connection timed out during banner exchange
ansible中如何正确使用跳转主机?
解决方案
这是可靠的解决方案:
在我的情况下,只需更换ansible_ssh_common_args
ansible_ssh_common_args: '-o ProxyCommand="ssh -W %h:%p -q ubuntu@102.106.XXX.XXX -i ./inventory/bastion.key.pem"'
推荐阅读
- javascript - 如何使用 Intersection Observer 延迟加载我的文章卡?
- flutter - 每当验证消息出现时,TextField 就会被推送,有人有解决方案吗?
- c# - 数据源更改时如何更改 datagridview 中添加的 Combobox 项?
- javascript - 重新加载 Dom 从头开始而不重新加载页面
- python - 如何打印带有解释的年份范围?
- inno-setup - Inno 设置 WizardForm / ComponentList 挂钩光标键
- windows - 在 Windows 批处理文件中执行 msiexec.exe 命令时如何引用不同文件夹中的 MSI 文件?
- sql - 用“in”删除重复记录
- javascript - 如何从节点获取调用中获取原始文件数据?
- reactjs - 反应中的pdf文档