1.ansible Missing sudo password
1.1尝试使用该选项-kK。它将提示输入密码。
$ ansible-playbook mail.yml -kK SSH password: BECOME password[defaults to SSH password]:
- -k,--ask-pass:询问连接密码
- -K,--ask-become-pass:询问特权升级密码
1.2 You can specificy the sudo password when running the Ansible playbook:
ansible-playbook playbook.yml -i inventory.ini --extra-vars "ansible_sudo_pass=yourPassword"
1.3将此添加到您的/ etc / sudoers文件
## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL## Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL username-u-want-to-allow ALL=(ALL) NOPASSWD: ALL
2. ansible出现Failed to connect to the host via ssh
2.1 公钥验证出现问题一般检查selinux是否关闭,还有就是authorized_keys权限是否为600