Ansible reports an error through sudo user execution: "user" is not in the sudoers file

First look at the screenshot of the error report:

My inventory file is written like this

After checking the inventory file, there is no problem, and users who manually pass "xiaofang" can log in normally. The problem lies in the logged-in machine.

#  vim /etc/sudoers

I have to add such a line here

Execute the ansible command again and it will succeed

 

 

Guess you like

Origin blog.csdn.net/weixin_42182501/article/details/114527247