Wednesday 16 March 2022

| UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: Invalid multiplex command.", "unreachable": true


Issue


ansible -m ping -i inventory.ini webservers

localhost | UNREACHABLE! => {

    "changed": false,

    "msg": "Failed to connect to the host via ssh: Invalid multiplex command.",

    "unreachable": true

}


Troubleshoot


vim devops.ini

ansible_ssh_common_args='-O StrictHostKeyChecking=no'

#change to

ansible_ssh_common_args='-o StrictHostKeyChecking=no'


Result


ansible -m ping -i devops.ini webservers

localhost | SUCCESS => {

    "ansible_facts": {

        "discovered_interpreter_python": "/usr/bin/python3"

    },

    "changed": false,

    "ping": "pong"

}


No comments:

Post a Comment