Wednesday, 16 March 2022

| UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host localhost port 22: Connection refused",


 Issue


ansible -m ping -i inventory.ini webservers

localhost | UNREACHABLE! => {

    "changed": false,

    "msg": "Failed to connect to the host via ssh: ssh: connect to host localhost port 22: Connection refused",

    "unreachable": true

}


Troubleshoot


#specify port number

ansible_port=42006


No comments:

Post a Comment