MichaelCade / 90DaysOfDevOps

This repository started out as a learning in public project for myself and has now become a structured learning map for many in the community. We have 3 years under our belt covering all things DevOps, including Principles, Processes, Tooling and Use Cases surrounding this vast topic.

Home Page:https://www.90daysofdevops.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible - Unable to ping my webservers

vineethsankre opened this issue · comments

Hey, I'm following your ansible tutorial and I'm stuck there. I deployed web01, web02, db01, and loadbalancer by the vagrantfile you provided. I'm using wsl as my control node and added the hosts in /etc/ansible/hosts. From here, I'm unable to move further, I can't ping into my servers.

I ran ansible webservers -m ping and I get this error everytime, not even ping to my windows host machine

192.168.29.1 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.29.1 port 22: Connection timed out",
"unreachable": true
}

Ok and if you go in via the virtualbox console to the machine? Firewall? Network connectivity? I was also using WSL,

I probably need to take a look at these sections as they could be outdated now.

Hey, I figured it out. After deploying the servers, I have to manually edit the /etc/ssh/sshd_config file and changed this "PubKeyAuthentication yes". Also, allowing firewall rules 'sudo ufw allow 2211/tcp' helped.