技术解析
目标机 mysql
需要使用 192.168.13.44:1022
机器进行跳转才能登录,想在 ansible
中自动进行跳转,查阅了资料,按以下参数进行配置无效, 不清楚是没配置对还是咋的了:
# inventory
[mysql]
ansible_host=10.9.13.22 ansible_ssh_user=root ansible_ssh_pass="admin&*()"
[mysql:vars]
ansible_ssh_common_args='-o ProxyCommand="sshpass -p passwork ssh -W %h:%p -q [email protected]:1022"'
# 测试指令
ansible myql -m ping
# 执行结果
mysql | UNREACHAB大带宽服务器LE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: kex_exchange_identification: Connection closed by remote host",
"unreachable": true
}
请教下各位