異なる IP を持つ 2 つの Vagrant インスタンスが実行されています。
192.168.33.17 [Ansible installed here]
192.168.33.19 [Another server where I am trying to connect]
私の Ansible hosts ファイルが入っ/etc/ansible/hostsていて、次のようになっています。
[example]
192.168.33.19:2222
次のコマンドを使用して、SSH 経由で 2 番目のサーバーに簡単に接続できます。
ssh vagrant@192.168.33.19
パスワードなし。
しかし、Ansible コマンドを実行するとエラーが発生します。
[root@centos72x64 vagrant]# ansible example -m ping -u vagrant
192.168.33.19 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh.",
"unreachable": true
}
このエラーを解決するにはどうすればよいですか?