I can't ping the machine I set up with a vagrant from an executable.

Asked 2 years ago, Updated 2 years ago, 104 views

I started learning about the possible, but when I ran ansable all-i hosts-mping, the following error occurred and I couldn't proceed.

vagrant-machine | UNREACHABLE!=>{
    "changed"—false, 
    "msg": "Failed to connect to the host via ssh: connect to host 127.0.0.1 port 22: Connection refused\r\n", 
    "unreachable"—true
}

vagrant ssh-config results are as follows

Host default
  HostName 127.0.0.1
  User vagrant
  Port 2200
  UserKnownHostsFile/dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile/Users/user/Dev/xxxaxkx/ansable-tutorial/.vagrant/machines/default/virtualbox/private_key
  IdentityOnly yes
  LogLevel FATAL

Also, the hosts list is defined in the hosts file and written in one line as follows.

vagrant-machine available_host=127.0.0.1 available-port=2200 available_user=vagrant available_ssh_private_key_file=.vagrant/machines/default/virtualbox/private_key

Ansible.cfg is placed in the current directory and described as follows.

 [defaults]
host_key_checking=False

I don't see any extra line breaks in particularly.
Please let me know how to solve this problem.

vagrant ansible

2022-09-30 11:38

1 Answers

Based on the error content, it appears that an attempt to connect to 127.0.0.1:22 has failed.

Host Listing Description

ansable-port=2200

where

ansable_port=2200

Isn't that a mistake?
(I think I'm trying to connect to the default number 22 because the port number specification is not working)


2022-09-30 11:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.