Hello All,
Running ansible but keep getting failed to connect to host via ssh.
Vagrant Version: 2.2.10
Host OS: Windows 10 (+ virtualbix)
Guest OS: bento/ubuntu-18.04
WSL version: 2
Vagrantfile:
Vagrant.configure(“2”) do |config|
config.vm.box = “ubuntu/trusty64”
config.vm.synced_folder “.”, “/vagrant”, disabled: true
config.vm.provider “virtualbox” do |vb|
vb.memory = “4024”
vb.cpus = “1”
end
config.vm.provision “ansible” do |ansible|
ansible.become = true
ansible.verbose = “v”
ansible.playbook = “roles/firewall.yml”
ansible.galaxy_roles_path = “./roles”
end
end
Expected behavior:
Successful provision
Actual behavior:
TASK [Gathering Facts] *********************************************************
fatal: [default]: UNREACHABLE! => {“changed”: false, “msg”: “Failed to connect to the host via ssh: ssh: connect to host 127.0.0.1 port 2222: Connection refused”, “unreachable”: true}
Steps to reproduce:
-
- minimal firewall.yml file
-
- vagrant up --provision
I tried:
-
- Run vagrant up in PowerShell
-
- Run vagrant ss in WSL2
But nothing happens:
So then I tried using raw SSH: