S
S
s_katala2017-11-23 11:25:44
Ansible
s_katala, 2017-11-23 11:25:44

How to connect to ansible localhost?

It costs centos 7 desktop
how to connect to the server to localhost or 127.0.0.1 as root?
I make a request

127.0.0.1 ansible_ssh_host=127.0.0.1 ansible_ssh_user=root ansible_ssh_pass=mypass

Gives an error when checking
127.0.0.1 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to host 127.0.0.1 port 22: Connection refused\r\n",
"unreachable": true
}
if added error Failed to connect to the host via ssh: ssh_exchange_identification: Connection closed by remote host\r\n
ansible_ssh_port=80

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
s_katala, 2017-11-23
@s_katala

Solved the issue myself

localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question