Add config.arguments for Chef

* Adds chef.arguments to Chef::Provisioner::Config
* Usable in both chef-client and chef-solo
* Specify as a string, "-L /tmp/foo.log", e.g.
This commit is contained in:
jtimberman 2012-08-10 12:58:43 -06:00
parent de73b65635
commit 50e9f83970
3 changed files with 5 additions and 2 deletions

View File

@ -97,6 +97,7 @@ module VagrantPlugins
attr_accessor :binary_path attr_accessor :binary_path
attr_accessor :binary_env attr_accessor :binary_env
attr_accessor :attempts attr_accessor :attempts
attr_accessor :arguments
attr_writer :run_list attr_writer :run_list
# Provide defaults in such a way that they won't override the instance # Provide defaults in such a way that they won't override the instance

View File

@ -91,7 +91,8 @@ module VagrantPlugins
def run_chef_client def run_chef_client
command_env = config.binary_env ? "#{config.binary_env} " : "" command_env = config.binary_env ? "#{config.binary_env} " : ""
command = "#{command_env}#{chef_binary_path("chef-client")} -c #{config.provisioning_path}/client.rb -j #{config.provisioning_path}/dna.json" command_args = config.arguments ? " #{config.arguments}" : ""
command = "#{command_env}#{chef_binary_path("chef-client")} -c #{config.provisioning_path}/client.rb -j #{config.provisioning_path}/dna.json #{command_args}"
config.attempts.times do |attempt| config.attempts.times do |attempt|
if attempt == 0 if attempt == 0

View File

@ -185,7 +185,8 @@ module VagrantPlugins
def run_chef_solo def run_chef_solo
command_env = config.binary_env ? "#{config.binary_env} " : "" command_env = config.binary_env ? "#{config.binary_env} " : ""
command = "#{command_env}#{chef_binary_path("chef-solo")} -c #{config.provisioning_path}/solo.rb -j #{config.provisioning_path}/dna.json" command_args = config.arguments ? " #{config.arguments}" : ""
command = "#{command_env}#{chef_binary_path("chef-solo")} -c #{config.provisioning_path}/solo.rb -j #{config.provisioning_path}/dna.json #{command_args}"
config.attempts.times do |attempt| config.attempts.times do |attempt|
if attempt == 0 if attempt == 0