Skip to content

Defaults do not work with groups #27

Description

@jonathandelanders

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 -%>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions