Skip to content

Commit

Permalink
chef-soloのパスを直接指定しているとNOPASSWDが何故か効かないので、ひとまずALLに。求む解決策
Browse files Browse the repository at this point in the history
  • Loading branch information
naoya committed Feb 4, 2013
1 parent 0711ab3 commit 1f6880f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion site-cookbooks/adduser/templates/default/sudoers.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/home/<%= node['user']['name'] %>/.rbenv/shims

<%= node['user']['name'] %> ALL=(ALL) NOPASSWD: /home/<%= node['user']['name'] %>/.rbenv/shims/chef-solo
<%= node['user']['name'] %> ALL=(ALL) NOPASSWD: ALL

2 comments on commit 1f6880f

@znz
Copy link

@znz znz commented on 1f6880f Feb 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sudo chef-solo/usr/bin/chef-solo が実行されてしまうのが原因のようなので、以下のようにしてみたら NOPASSWD がききました。
whichprintenv が入っているのは sudo which chef-solo とか sudo printenv PATH で確認していたためです。

Defaults:fiorung    secure_path = /home/fiorung/.rbenv/shims:/sbin:/bin:/usr/sbin:/usr/bin
fiorung ALL=(ALL) NOPASSWD: /home/fiorung/.rbenv/shims/chef-solo, /usr/bin/which, /usr/bin/printenv

@naoya
Copy link
Owner Author

@naoya naoya commented on 1f6880f Feb 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secure_path で先にもってこないといけないんですね!!

Please sign in to comment.