我正在编写一部剧本,该剧本需要通过代理连接到几个不同的服务器。
我能够使用腻子和代理来测试连接。基本上,转到连接->代理,然后选择HTTP并添加代理主机。
但是,我无法从Ansible服务器使用SSH复制它。我尝试了不同的ssh命令:
ssh -L jumphost.example.org:80 [email protected] -p 443
ssh -J jumphost.example.org:80 [email protected]
ssh -o ProxyCommand="ssh -W %h:%p jumphost.example.org" server.example.org
ssh -tt jumphost.example.org ssh -tt server.example.org
我知道有很多使用nc
的选项,但是我没有尝试过,因为它没有安装在服务器上。
有没有办法使用代理连接到远程主机?
谢谢
您可以尝试这个吗?-主持人:全部remote_user:root
tasks:
- name: Install cobbler
package:
name: cobbler
state: present
environment:
http_proxy: http://proxy.example.com:8080