gpt4 book ai didi

vagrant - Ansible 任务不能在某个 Vagrant 盒子上拥有 sudo_user (便当)

转载 作者:行者123 更新时间:2023-12-02 10:53:10 25 4
gpt4 key购买 nike

以下任务在 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

关于vagrant - Ansible 任务不能在某个 Vagrant 盒子上拥有 sudo_user (便当),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21814361/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com