diff options
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb | 2 | ||||
-rw-r--r-- | lib/chef/resource/support/client.erb | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb index 0e68582af0..c2a6e4254b 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/_chef_client_config.rb @@ -1,6 +1,8 @@ chef_client_config "Create chef-client's client.rb" do chef_server_url "https://localhost" chef_license "accept" + ohai_optional_plugins %i{Passwd Lspci Sysctl} + ohai_disabled_plugins %i{Sessions Interrupts} additional_config <<~CONFIG begin require 'aws-sdk' diff --git a/lib/chef/resource/support/client.erb b/lib/chef/resource/support/client.erb index 6507c74440..69faf0fcf6 100644 --- a/lib/chef/resource/support/client.erb +++ b/lib/chef/resource/support/client.erb @@ -22,6 +22,12 @@ <% next if instance_variable_get(prop).nil? || instance_variable_get(prop).empty? -%> <%=prop.delete_prefix("@") %> <%= instance_variable_get(prop).inspect %> <% end -%> +<%# ohai_disabled_plugins and ohai_optional_plugins properties don't match the config value perfectly-%> +<% %w(@ohai_disabled_plugins + @ohai_optional_plugins).each do |prop| -%> +<% next if instance_variable_get(prop).nil? || instance_variable_get(prop).empty? -%> +<%=prop.gsub("@ohai_", "ohai.") %> <%= instance_variable_get(prop).inspect %> +<% end -%> <%# log_location is special due to STDOUT/STDERR from String -> IO Object -%> <% unless @log_location.nil? %> <% if @log_location.is_a?(String) && %w(STDOUT STDERR).include?(@log_location) -%> |