1

The ansible command : ansible all -m ping -i host.yml

Here is my 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"'

Error msg:

Failed to connect to the host via ssh: Connection timed out during banner exchange

How to correctly use the jump host in ansible?

Cherie
  • 31
  • 1
  • 5

1 Answers1

0

Here is the ansible solution:

How do I configure a jump host to access servers that I have no direct access to?

In my case, just replace the 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"'
Cherie
  • 31
  • 1
  • 5