Vagrant Ansible任务不能让sudo_用户在某个流浪者盒子(bento)上

Vagrant Ansible任务不能让sudo_用户在某个流浪者盒子(bento)上,vagrant,ansible,bento,Vagrant,Ansible,Bento,以下任务在一个流浪者盒子上失败(ubuntu 12.04 chefless) fd 我需要创建自己的盒子吗 ==etc/sudoers的内容 Defaults env_reset Defaults exempt_group=sudo Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias s

以下任务在一个流浪者盒子上失败(ubuntu 12.04 chefless)

fd

我需要创建自己的盒子吗

==etc/sudoers的内容

Defaults    env_reset
Defaults    exempt_group=sudo
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=NOPASSWD:ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

非常确定您还必须将
sudo:yes
添加到
sudo\u用户
参数的下方/上方。

可能在这里迟到了,但我今天遇到了相同的错误,并用

username ALL=(ALL) NOPASSWD: ALL

您的
sudo
组缺少括号中的
ALL

了解您的sudo权限在vagrant框中会很有帮助。在你的vagrant框中,运行
grep vagrant/etc/sudoers
并将输出添加到你的问题中。我添加了/etc/sudoersI的全部内容。我使用
sudo_user
时也会遇到同样的错误,即使我添加
sudo:yes
操作延迟,但这也是我的解决方案(chef/Ubuntu14 with vagrant)。
Defaults    env_reset
Defaults    exempt_group=sudo
Defaults    mail_badpass
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=NOPASSWD:ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
username ALL=(ALL) NOPASSWD: ALL