配置相关

10.10.10.5 | FAILED! => {
“msg”: “Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this. Please add this host’s fingerprint to your known_hosts file to manage this host.”
}

需要添加对应主机到信任清单。

解决方法:

  1. 使用ssh连接一次对应主机(会让你输入yes/no,输入yes)

  2. 设置参数为不检查key

1
2
3
4
5
6
7
8
9
10
11
12
13
vi /etc/ansible/ansible.cfg
在文件中进行搜索定位到

:/host_key_checking

# uncomment this to disable SSH key host checking

#host_key_checking = False
修改后:

# uncomment this to disable SSH key host checking

host_key_checking = False

[WARNING]: Platform linux on host -.-.-.- is using the discovered Python interpreter at /usr/bin/python, but future installation of another Python interpreter could change this. See https://docs.ansible.com/ansible/2.9/reference_appendices/interpreter_discovery.html for more information.

/etc/ansible/ansible.cfg中的[default]中添加

1
interpreter_python=auto_legacy_silent

ssh-copy-id出现以下错误Permission denied, please try again.

在目标主机的sshd_config文件中开启允许root用户登录

1
2
3
4
#sshd_config
PermitRootLogin yes
#重启ssh服务
/path/to/ssh restart

roles相关

[ERROR]: failed to download the file:
[WARNING]: - geerlingguy.nginx was NOT installed successfully.
ERROR! - you can use –ignore-errors to skip failed roles and finish processing the list.

安装某些role时,出现错误

1
#