CSS   发布时间:2022-04-17  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Ansible任务不能在某个Vagrant盒子上有sudo_user(便当)大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在Vagrant框(ubuntu 12.04 chefless) http://opscode.github.io/bento/上,以下任务失败
- name: ensure database is created
    POSTGResql_db: name={{dbnamE}}
    sudo_user: POSTGRes

FD

failed: [192.168.78.8] => {"failed": true,"parsed": falsE}
invalid output was: Sorry,user vagrant is not allowed to execute '/bin/sh -c echo SUDO-succesS-lalargtagydzinzenmftocwaiucrmxuk; /usr/bin/python /tmp/ansible-1392568385.89-150322815243790/POSTGResql_db' as POSTGRes on cogol-dev.

我需要创建自己的盒子吗?

=== / 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

解决方法

可能在这里迟到了,但我今天遇到了同样的错误,并解决了它
username ALL=(ALL) NOPASSWD: ALL

你的sudo组在括号中错过了这个ALL

大佬总结

以上是大佬教程为你收集整理的Ansible任务不能在某个Vagrant盒子上有sudo_user(便当)全部内容,希望文章能够帮你解决Ansible任务不能在某个Vagrant盒子上有sudo_user(便当)所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。