Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions manifests/sudoers.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
# [*runas*]
# The user that the command may be run as.
#
# [*context*]
# The SELinux domain and role the command will be run as by default.
#
# [*cmnds*]
# The commands which the user is allowed to run.
#
Expand All @@ -45,6 +48,7 @@
# comment => 'World domination.',
# users => ['pinky', 'brain'],
# runas => ['root'],
# context => 'TYPE=unconfined_t ROLE=unconfined_r',
# cmnds => ['/bin/bash'],
# tags => ['NOPASSWD'],
# defaults => [ 'env_keep += "SSH_AUTH_SOCK"' ]
Expand All @@ -66,6 +70,7 @@
$comment = undef,
$ensure = 'present',
$runas = ['root'],
$context = undef,
$tags = [],
$defaults = [],
) {
Expand Down
4 changes: 2 additions & 2 deletions templates/sudoers.erb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Defaults!<%= @sane_name.upcase %>_CMNDS <%= @defaults.class == Array ? @defaults
<% end -%>

<% if @users then -%>
<%= @sane_name.upcase %>_USERS <%= @sane_name.upcase %>_HOSTS = (<%= @sane_name.upcase %>_RUNAS) <%= tags %> <%= @sane_name.upcase %>_CMNDS
<%= @sane_name.upcase %>_USERS <%= @sane_name.upcase %>_HOSTS = (<%= @sane_name.upcase %>_RUNAS) <%= @context.class == String ? @context %> <%= tags %> <%= @sane_name.upcase %>_CMNDS
<% else -%>
%<%= @group %> <%= @sane_name.upcase %>_HOSTS = (<%= @sane_name.upcase %>_RUNAS) <%= tags %> <%= @sane_name.upcase %>_CMNDS
%<%= @group %> <%= @sane_name.upcase %>_HOSTS = (<%= @sane_name.upcase %>_RUNAS) <%= @context.class == String ? @context %> <%= tags %> <%= @sane_name.upcase %>_CMNDS
<% end -%>