Ansible: how to solve “sudo: a password is required” error? [duplicate]

。_饼干妹妹 提交于 2019-12-02 00:07:52

You get an error:

sudo: a password is required

It doesn't mean you can't connect to the target machine it means you need to provide a password to run a command with elevated permissions (or that you can't run a command with elevated permissions altogether).

On the contrary, it means the connection is being established with no problems.

Fix your sudoers configuration on the affected machines.

The main issue is that for ansible task needs the password of 4 servers, so i did export ask sudo password and it worked. It was failing because of the password.

export ANSIBLE_ASK_SUDO_PASS=true
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!