From 50e9f83970b8283172d8fece8f8f9d4fcc8bff8d Mon Sep 17 00:00:00 2001 From: jtimberman Date: Fri, 10 Aug 2012 12:58:43 -0600 Subject: [PATCH] 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. --- plugins/provisioners/chef/provisioner/base.rb | 1 + plugins/provisioners/chef/provisioner/chef_client.rb | 3 ++- plugins/provisioners/chef/provisioner/chef_solo.rb | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/provisioners/chef/provisioner/base.rb b/plugins/provisioners/chef/provisioner/base.rb index 313c0bdbf..bac8a0f49 100644 --- a/plugins/provisioners/chef/provisioner/base.rb +++ b/plugins/provisioners/chef/provisioner/base.rb @@ -97,6 +97,7 @@ module VagrantPlugins attr_accessor :binary_path attr_accessor :binary_env attr_accessor :attempts + attr_accessor :arguments attr_writer :run_list # Provide defaults in such a way that they won't override the instance diff --git a/plugins/provisioners/chef/provisioner/chef_client.rb b/plugins/provisioners/chef/provisioner/chef_client.rb index aa1e8faae..b797e63bd 100644 --- a/plugins/provisioners/chef/provisioner/chef_client.rb +++ b/plugins/provisioners/chef/provisioner/chef_client.rb @@ -91,7 +91,8 @@ module VagrantPlugins def run_chef_client 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| if attempt == 0 diff --git a/plugins/provisioners/chef/provisioner/chef_solo.rb b/plugins/provisioners/chef/provisioner/chef_solo.rb index 14ca4906a..ea6b40f0f 100644 --- a/plugins/provisioners/chef/provisioner/chef_solo.rb +++ b/plugins/provisioners/chef/provisioner/chef_solo.rb @@ -185,7 +185,8 @@ module VagrantPlugins def run_chef_solo 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| if attempt == 0