Merge pull request #1944 from miketheman/chef_cfg_formatter

Adds formatter option to Chef Provisioner [GH-1250]
This commit is contained in:
Mitchell Hashimoto 2013-07-17 21:54:27 -07:00
commit 8ef30f5c00
4 changed files with 13 additions and 1 deletions

View File

@ -7,6 +7,7 @@ module VagrantPlugins
attr_accessor :binary_path attr_accessor :binary_path
attr_accessor :binary_env attr_accessor :binary_env
attr_accessor :custom_config_path attr_accessor :custom_config_path
attr_accessor :formatter
attr_accessor :http_proxy attr_accessor :http_proxy
attr_accessor :http_proxy_user attr_accessor :http_proxy_user
attr_accessor :http_proxy_pass attr_accessor :http_proxy_pass
@ -31,6 +32,7 @@ module VagrantPlugins
@binary_path = UNSET_VALUE @binary_path = UNSET_VALUE
@binary_env = UNSET_VALUE @binary_env = UNSET_VALUE
@custom_config_path = UNSET_VALUE @custom_config_path = UNSET_VALUE
@formatter = UNSET_VALUE
@http_proxy = UNSET_VALUE @http_proxy = UNSET_VALUE
@http_proxy_user = UNSET_VALUE @http_proxy_user = UNSET_VALUE
@http_proxy_pass = UNSET_VALUE @http_proxy_pass = UNSET_VALUE
@ -55,6 +57,7 @@ module VagrantPlugins
@binary_path = nil if @binary_path == UNSET_VALUE @binary_path = nil if @binary_path == UNSET_VALUE
@binary_env = nil if @binary_env == UNSET_VALUE @binary_env = nil if @binary_env == UNSET_VALUE
@custom_config_path = nil if @custom_config_path == UNSET_VALUE @custom_config_path = nil if @custom_config_path == UNSET_VALUE
@formatter = nil if @formatter == UNSET_VALUE
@http_proxy = nil if @http_proxy == UNSET_VALUE @http_proxy = nil if @http_proxy == UNSET_VALUE
@http_proxy_user = nil if @http_proxy_user == UNSET_VALUE @http_proxy_user = nil if @http_proxy_user == UNSET_VALUE
@http_proxy_pass = nil if @http_proxy_pass == UNSET_VALUE @http_proxy_pass = nil if @http_proxy_pass == UNSET_VALUE

View File

@ -71,7 +71,8 @@ module VagrantPlugins
:https_proxy_user => @config.https_proxy_user, :https_proxy_user => @config.https_proxy_user,
:https_proxy_pass => @config.https_proxy_pass, :https_proxy_pass => @config.https_proxy_pass,
:log_level => @config.log_level.to_sym, :log_level => @config.log_level.to_sym,
:no_proxy => @config.no_proxy :no_proxy => @config.no_proxy,
:formatter => @config.formatter
}.merge(template_vars)) }.merge(template_vars))
# Create a temporary file to store the data so we # Create a temporary file to store the data so we

View File

@ -32,6 +32,10 @@ pid_file "/var/run/chef/chef-client.pid"
Mixlib::Log::Formatter.show_time = true Mixlib::Log::Formatter.show_time = true
<% if formatter %>
formatter "<%= formatter %>"
<% end %>
<% if custom_configuration -%> <% if custom_configuration -%>
load "<%= custom_configuration %>" load "<%= custom_configuration %>"
<% end -%> <% end -%>

View File

@ -28,6 +28,10 @@ https_proxy_user <%= https_proxy_user.inspect %>
https_proxy_pass <%= https_proxy_pass.inspect %> https_proxy_pass <%= https_proxy_pass.inspect %>
no_proxy <%= no_proxy.inspect %> no_proxy <%= no_proxy.inspect %>
<% if formatter %>
formatter "<%= formatter %>"
<% end %>
<% if custom_configuration -%> <% if custom_configuration -%>
load "<%= custom_configuration %>" load "<%= custom_configuration %>"
<% end -%> <% end -%>