diff options
author | Tim Smith <tsmith@chef.io> | 2018-03-22 20:55:26 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-03-22 20:55:26 -0700 |
commit | d7a8d312dc53cd0325ae07ced1f426251f5bed8f (patch) | |
tree | f9d8fc13664a6cd0ad5e32a97af6172c3f008dfc /lib/chef/resource/support | |
parent | 0938c0cecd5d2da3e117f78ed9d13c9e9f0e235f (diff) | |
download | chef-d7a8d312dc53cd0325ae07ced1f426251f5bed8f.tar.gz |
Fix template to match the updated version in the cookbook
This fixes an issue when writing out env_keep only configs. Found this via a super test suite against 14.0.159
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource/support')
-rw-r--r-- | lib/chef/resource/support/sudoer.erb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/support/sudoer.erb b/lib/chef/resource/support/sudoer.erb index c54507535b..d19540bd33 100644 --- a/lib/chef/resource/support/sudoer.erb +++ b/lib/chef/resource/support/sudoer.erb @@ -11,7 +11,7 @@ Defaults env_keep += "<%= env_keep %>" Defaults env_keep -= "<%= env_keep %>" <% end -%> <% @commands.each do |command| -%> -<% if @sudoer %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> +<% unless @sudoer.empty? %><%= @sudoer %> <%= @host %>=(<%= @runas %>) <%= 'NOEXEC:' if @noexec %><%= 'NOPASSWD:' if @nopasswd.to_s == 'true' %><%= 'SETENV:' if @setenv.to_s == 'true' %><%= command %><% end -%> <% end -%> <% unless @defaults.empty? %> Defaults:<%= @sudoer %> <%= @defaults.join(',') %> |