Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Chef Client
-
Labels:None
Description
In my environment I run chef on demand for explicit control of change. In addition, I would like to run chef-client always on or on a schedule that just performs the inventory collection tasks via ohai, but without making changes to the host. To support this, chef-client needs a command line option to skip the 'converge()' step of a run. I've created a patch for this and will attach to this ticket.
The following patches chef-client to add "-C, --no-convergence Disable convergence to prevent the running of cookbooks"
It's available here http://github.com/sdossett/chef/tree/001
--- chef/lib/chef/application/client.rb +++ chef/lib/chef/application/client.rb @@ -138,6 +138,12 @@ class Chef::Application::Client < Chef::Application :proc => lambda {|v| puts "Chef: #{::Chef::VERSION}"}, :exit => 0 + option :no_convergence, + :short => "-C", + :long => "--no-convergence", + :description => "Disable convergence to prevent the running of cookbooks", + :proc => lambda { |p| true } + def initialize super--- chef/lib/chef/client.rb +++ chef/lib/chef/client.rb @@ -151,7 +151,11 @@ class Chef run_started run_context = setup_run_context - converge(run_context) + if Chef::Config[:no_convergence] + Chef::Log.info("Skipping Convergence") + else + converge(run_context) + end save_updated_node run_status.stop_clock--- chef/lib/chef/config.rb +++ chef/lib/chef/config.rb @@ -163,6 +163,7 @@ class Chef run_command_stdout_timeout 120 solo false splay nil + no_convergence false # Set these to enable SSL authentication / mutual-authentication # with the server