Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaults do not work with groups #27

Open
jonathandelanders opened this issue Mar 22, 2015 · 2 comments
Open

Defaults do not work with groups #27

jonathandelanders opened this issue Mar 22, 2015 · 2 comments

Comments

@jonathandelanders
Copy link

First off, Fantastic module..

When I attempt to deploy defaults with a group ( specifically !requiretty ) the settings do not take. I patched the module to work on my puppet master and the code below to allow using defaults with group.

diff --git a/modules/sudo/templates/sudoers.erb b/modules/sudo/templates/sudoers.erb
index e852b31..9902fda 100644
--- a/modules/sudo/templates/sudoers.erb
+++ b/modules/sudo/templates/sudoers.erb
@@ -13,7 +13,11 @@ Cmnd_Alias  <%= @sane_name.upcase %>_CMNDS = <%= @cmnds.class == Array ? @cmnds.

 <% if not @defaults.empty? then -%>

+<% if @users then -%>
 Defaults:<%= @sane_name.upcase %>_USERS <%= @defaults.class == Array ? @defaults.join(", ") : @defaults %>
+<% else -%>
+Defaults:%<%= @group %> <%= @defaults.class == Array ? @defaults.join(", ") : @defaults %>
+<% end -%>
 <% end -%>

 <% if @users then -%>
@jonathandelanders jonathandelanders changed the title Defaults do not work on groups Defaults do not work with groups Mar 22, 2015
@gotyaoi
Copy link

gotyaoi commented Apr 20, 2015

While it doesn't look as if this issue is accurate to the file as it currently exists, I think this is something that bears discussion. There are some defaults that seem like they should be applied per user (requiretty, in my case), and some that seem like the might be better per command (log_output, for example). Perhaps it should be a further setting that determines if the default should be applied to the user/group, as in @jonathandelanders example, or to the command, as it currently is?

@ebouliane
Copy link

I forked the template to provide a proper groups fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants