Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

[Dúvida] Failed to connect to the host via ssh: ssh: connect to host 172.17.177.40 port 22: No route to host

Mais alguém teve esse erro? Segue a pilha completa

ansible 2.10.8
  config file = None
  configured module search path = ['/home/alv/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0]
No config file found; using defaults
setting up inventory plugins
host_list declined parsing /home/alv/Documentos/Cursos/Alura/wordpress_com_ansible/hosts as it did not pass its verify_file() method
auto declined parsing /home/alv/Documentos/Cursos/Alura/wordpress_com_ansible/hosts as it did not pass its verify_file() method
Parsed /home/alv/Documentos/Cursos/Alura/wordpress_com_ansible/hosts inventory source with ini plugin
Loading callback plugin minimal of type stdout, v2.0 from /usr/lib/python3/dist-packages/ansible/plugins/callback/minimal.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
META: ran handlers
<172.17.177.40> ESTABLISH SSH CONNECTION FOR USER: vagrant
<172.17.177.40> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o 'IdentityFile="/home/alv/Documentos/Cursos/Alura/wordpress_com_ansible/.vagrant/machines/wordpress/virtualbox/private_key"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="vagrant"' -o ConnectTimeout=10 -o ControlPath=/home/alv/.ansible/cp/4bd7571f4e 172.17.177.40 '/bin/sh -c '"'"'echo ~vagrant && sleep 0'"'"''
<172.17.177.40> (255, b'', b'OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 172.17.177.40 is address\r\ndebug3: expanded UserKnownHostsFile \'~/.ssh/known_hosts\' -> \'/home/alv/.ssh/known_hosts\'\r\ndebug3: expanded UserKnownHostsFile \'~/.ssh/known_hosts2\' -> \'/home/alv/.ssh/known_hosts2\'\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/home/alv/.ansible/cp/4bd7571f4e" does not exist\r\ndebug3: ssh_connect_direct: entering\r\ndebug1: Connecting to 172.17.177.40 [172.17.177.40] port 22.\r\ndebug3: set_sock_tos: set socket 3 IP_TOS 0x10\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address 172.17.177.40 port 22: No route to host\r\nssh: connect to host 172.17.177.40 port 22: No route to host\r\n')
172.17.177.40 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files\r\ndebug1: /etc/ssh/ssh_config line 21: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 172.17.177.40 is address\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/alv/.ssh/known_hosts'\r\ndebug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/alv/.ssh/known_hosts2'\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/home/alv/.ansible/cp/4bd7571f4e\" does not exist\r\ndebug3: ssh_connect_direct: entering\r\ndebug1: Connecting to 172.17.177.40 [172.17.177.40] port 22.\r\ndebug3: set_sock_tos: set socket 3 IP_TOS 0x10\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: connect to address 172.17.177.40 port 22: No route to host\r\nssh: connect to host 172.17.177.40 port 22: No route to host",
    "unreachable": true
}
1 resposta
solução!

Deixei dessa forma para funcionar:


Vagrant.configure("2") do |config|

  config.vm.box = "ubuntu/trusty64"

  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
  end

  config.vm.define "wordpress" do |m|
    m.vm.network "public_network", ip: "192.168.0.211"
  end

end

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software