【发布时间】:2020-06-10 03:59:48
【问题描述】:
在我们的工作设置中,有一个 remote server B 只能通过远程服务器 A 访问。
- 如何从运行 ansible 的本地系统通过远程服务器 A 在远程服务器 B 上运行 ansible 命令/剧本,即 本地系统 --> 远程服务器 A --> 远程服务器 B
-
remote server B可以通过 ssh 访问remote server A。但我无权访问remote server B的 ssh 密钥
这是我根据下面的答案在我的 inventory.yaml 文件中尝试做的事情
hosts:
remote-serverB:
vars:
ansible_connection: "ssh"
ansible_user: "userB"
ansible_ssh_common_args: '-o ProxyCommand="sshpass -p <password> ssh -W %h:%p -q userA@remote-serverA"'
但我从 ansible 得到以下错误
UNREACHABLE {"changed": false, "msg": "EOF on stream; last 100 lines received:\nssh_exchange_identification: Connection closed by remote host\r", "unreachable": true}
【问题讨论】:
标签: ansible