ansible error logging (1)

Basic environment: docker based centos7

Ansible installed inside the docker

Whether the implementation of ansible all -m ping in the root or ordinary users have reported the following error:

172.20.1.1 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: Control socket connect(/home/hadoop/.ansible/ansible_control_path/55a69c5722): Connection refused\r\nFailed to connect to new control master",
"unreachable": true
}

Given above mean: a control to refuse the connection socket, the connection can not control the new host:

Solution:

In /etc/ansible/ansible.cfg file [ssh_connection] Add the following the following values:

control_path_dir = /dev/shm/ansible_control_path

If the configuration remote_user = root in /etc/ansible/ansible.cfg inside, then perform ansible time under a normal user, if you do not specify a remote user, the default is to use the root user will be prompted permission is denied, as follows:

 

This time you want to execute successfully, you need to specify the remote user, use the -u option, as follows:

 

Guess you like

Origin www.cnblogs.com/yjt1993/p/10980172.html