首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不可用的任务不能在某个Vagrant (bento)上有sudo_user

不可用的任务不能在某个Vagrant (bento)上有sudo_user
EN

Stack Overflow用户
提问于 2014-02-16 16:56:45
回答 2查看 2.7K关注 0票数 6

以下任务在Vagrant (ubuntu12.04 chefless) http://opscode.github.io/bento/上失败

代码语言:javascript
复制
  - name: ensure database is created
    postgresql_db: name={{dbname}}
    sudo_user: postgres

fd

代码语言:javascript
复制
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/sudoer的===含量

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-05-22 00:36:59

可能要迟到了,但我今天遇到了同样的错误,并用

代码语言:javascript
复制
username ALL=(ALL) NOPASSWD: ALL

您的sudo组在括号中缺少此ALL

票数 6
EN

Stack Overflow用户

发布于 2014-02-17 03:23:45

非常肯定您还必须将sudo: yes添加到sudo_user参数下面/之上。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21814361

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档