6

次のタスクは、Vagrant ボックス (ubuntu 12.04 シェフレス) 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
4

2 に答える 2

6

おそらくここで遅れていますが、今日同じエラーが発生し、解決しました

username ALL=(ALL) NOPASSWD: ALL

あなたのsudoグループALLは括弧内にこれがありません

于 2014-05-22T00:36:59.203 に答える
0

パラメータsudo: yesの下/上にも追加する必要があることを確認してください。sudo_user

于 2014-02-17T03:23:45.473 に答える