[root@k8s-master ~]# ansible-playbook /etc/ansible/copy.yml
PLAY [webservers] **************************************************************************************************************************************************************************************
TASK [copy files] **************************************************************************************************************************************************************************************
failed: [192.168.10.149] (item={u'dest': u'/root/copytest4.txt', u'src': u'/root/copytest4.txt'}) => {"ansible_loop_var": "item", "item": {"dest": "/root/copytest4.txt", "src": "/root/copytest4.txt"}, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
fatal: [192.168.10.149]: UNREACHABLE! => {"changed": false, "msg": "All items completed", "results": [{"ansible_loop_var": "item", "item": {"dest": "/root/copytest4.txt", "src": "/root/copytest4.txt"}, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}]}
failed: [192.168.10.150] (item={u'dest': u'/root/copytest4.txt', u'src': u'/root/copytest4.txt'}) => {"ansible_loop_var": "item", "item": {"dest": "/root/copytest4.txt", "src": "/root/copytest4.txt"}, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
failed: [192.168.10.148] (item={u'dest': u'/root/copytest4.txt', u'src': u'/root/copytest4.txt'}) => {"ansible_loop_var": "item", "item": {"dest": "/root/copytest4.txt", "src": "/root/copytest4.txt"}, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}
fatal: [192.168.10.150]: UNREACHABLE! => {"changed": false, "msg": "All items completed", "results": [{"ansible_loop_var": "item", "item": {"dest": "/root/copytest4.txt", "src": "/root/copytest4.txt"}, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}]}
fatal: [192.168.10.148]: UNREACHABLE! => {"changed": false, "msg": "All items completed", "results": [{"ansible_loop_var": "item", "item": {"dest": "/root/copytest4.txt", "src": "/root/copytest4.txt"}, "msg": "Failed to connect to the host via ssh: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).", "unreachable": true}]}
看到这个报错脑袋大,直到翻阅官网的github 找到解决
[root@k8s-master ~]# ansible all -m ping --ask-pass
SSH password:
192.168.10.148 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
192.168.10.150 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
192.168.10.149 | SUCCESS => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"ping": "pong"
}
- gssapi gssapi-with-mic gssapi-keyex Permission publickeygssapi gssapi-with-mic gssapi-keyex permission gssapi gssapi-with-mic gssapi-keyex unreachable gssapi-keyex gssapi-with-mic hadoop gssapi gssapi-with-mic集群 错误gssapi gssapi-with-mic authentication permission publickey coding denied permission publickey denied permission publickey denied github permission npm publickey install