lib/chef/application/windows_service.rb in chef-0.10.10.beta.1 vs lib/chef/application/windows_service.rb in chef-0.10.10.rc.1

- old
+ new

@@ -53,10 +53,21 @@ :short => "-i SECONDS", :long => "--interval SECONDS", :description => "Set the number of seconds to wait between chef-client runs", :proc => lambda { |s| s.to_i } + option :override_runlist, + :short => "-o RunlistItem,RunlistItem...", + :long => "-override-runlist RunlistItem,RunlistItem...", + :description => "Replace current run list with specified items", + :proc => lambda{|items| + items = items.split(',') + items.compact.map{|item| + Chef::RunList::RunListItem.new(item) + } + } + def service_init reconfigure Chef::Log.info("Chef Client Service initialized") end @@ -74,10 +85,13 @@ sleep splay # If we've stopped, then bail out now, instead of going on to run Chef next if state != RUNNING - @chef_client = Chef::Client.new(@chef_client_json) + @chef_client = Chef::Client.new( + @chef_client_json, + :override_runlist => config[:override_runlist] + ) @chef_client_json = nil @chef_client.run @chef_client = nil