質問が明確でない場合、および/または私がどこにいるべきかわからない場合は、事前に申し訳ありません。
SSH経由でansibleを使用してホストに接続する際に問題が発生しました。それは数日前に機能しましたが、私は数日間同じメッセージエラーが発生しています:
camille@ubuntu:~$ ansible all -m ping -u remote
192.xxx.xxx.xxx | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Connection timed out during banner exchange\r\n",
"unreachable": true
}
SSH接続(ansibleなし)はうまく機能しているので、私は問題を本当に理解していません。Ubuntu 16.04 VMでAnsibleを実行していますが、到達したいホストはCentOS 7VMです。
私のhostsファイルは次のとおりです。
[test]
192.xxx.xxx.xxx ansible_ssh_user=remote ansible_ssh_pass=password ansible_sudo_pass='password' #VM CentOS
ここで説明した解決策を試しましたが、問題は解決しませんでした。
編集1:リッパートップスソリューションを試し、他のいくつかのことをテストした後、私の在庫は次のようになりました:
[test]
192.xxx.xxx.xxx ansible_connection=ssh ansible_user=remote ansible_password='password'
[test:vars]
proxy=my_proxy:8080
また、タイムアウトを25に増やしてみましたが、まだ同じ問題があります。
編集2:
ansible.cfgファイルを変更した後、エラーメッセージが変更されました:
192.xxx.xxx.xxx | UNREACHABLE! => {
"changed": false,
"msg": "SSH Error: data could not be sent to remote host \"192.xxx.xxx.xxx\". Make sure this host can be reached over ssh",
"unreachable": true }
ssh接続を再度テストしましたが、まだ正常に機能しています。
私の設定ファイルは今:
[defaults]
timeout = 25
host_key_checking = False
roles_path = roles/
gathering = smart
[ssh_connection]
ssh_args = -o
ControlMaster=auto -o
ControlPersist=600s
control_path = %(directory)s/%%h-%%r
pipelining = True
これについて何か手がかりはありますか?
私はついに私の問題を修正しました!:D
リッパートップの提案を適用します(ありがとうございます):ansible.cfgを変更します(最初のメッセージを参照)
ホストファイルを次のように変更しました。
[テスト] 192.xxx.xxx.xxx ansible_user = remote ansible_password = remote_password ansible_ssh_user = remote ansible_ssh_pass = remote_password
[test:vars] proxy = my_proxy:8080
-cparamikoオプションを使用してホストにpingを実行しました
あなたの時間と助けをありがとうリッパートップス:)
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加