summaryrefslogtreecommitdiff
path: root/lib/chef/application.rb
diff options
context:
space:
mode:
authorJohn Keiser <jkeiser@opscode.com>2013-12-05 14:22:19 -0800
committerJohn Keiser <jkeiser@opscode.com>2013-12-06 13:50:10 -0800
commit5e87b84187e8d341fc83bdc90f5a1ce25c871610 (patch)
tree4d79c77f2b8131db9b3b971b8522e5d4d09b07cb /lib/chef/application.rb
parentd85df00ffbedfa440ea529d96a8dc9245fbe44ed (diff)
downloadchef-5e87b84187e8d341fc83bdc90f5a1ce25c871610.tar.gz
Add ability to run recipes directly from chef-client command line
Diffstat (limited to 'lib/chef/application.rb')
-rw-r--r--lib/chef/application.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb
index c1fc3a78a4..98bdedff7f 100644
--- a/lib/chef/application.rb
+++ b/lib/chef/application.rb
@@ -196,12 +196,17 @@ class Chef::Application
end
# Initializes Chef::Client instance and runs it
- def run_chef_client
+ def run_chef_client(specific_recipes = [])
Chef::Application.setup_server_connectivity
+ override_runlist = config[:override_runlist]
+ if specific_recipes.size > 0
+ override_runlist ||= []
+ end
@chef_client = Chef::Client.new(
@chef_client_json,
- :override_runlist => config[:override_runlist]
+ :override_runlist => config[:override_runlist],
+ :specific_recipes => specific_recipes
)
@chef_client_json = nil