2014-02-16 40 views
6

在流浪對話框以下任務失敗(Ubuntu的12.04 chefless)http://opscode.github.io/bento/Ansible任務不能有一定的流浪箱sudo_user(便當)

- 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 
+0

這將有助於瞭解你的sudo權限是在什麼流浪者箱子。在您的流浪漢中,運行'grep的無業遊民的/ etc/sudoers'和輸出添加到您的問題。 –

+0

我加在/ etc/sudoers文件 –

回答

6

大概遲到這裏,但我今天遇到了同樣的錯誤,並與

username ALL=(ALL) NOPASSWD: ALL 

解決它您sudo組缺少此ALL括號

+0

遲到OP,但+1因爲這是我的解決方案,太(廚師/ Ubuntu 14與流浪者)。 – msanford

0

敢肯定你還必須添加以下sudo: yes /的sudo_user PARAM以上。

+1

的全部內容,甚至當我加我使用'sudo_user'得到了同樣的錯誤,'須藤:yes' – sworisbreathing