diff --git a/attributes/php_agent.rb b/attributes/php_agent.rb index 5a683a1e..c187a586 100644 --- a/attributes/php_agent.rb +++ b/attributes/php_agent.rb @@ -10,6 +10,8 @@ default['newrelic']['php_agent']['startup_mode'] = nil default['newrelic']['php_agent']['web_server']['service_name'] = nil default['newrelic']['php_agent']['web_server']['service_action'] = nil +default['newrelic']['php_agent']['web_server']['service_provider'] = nil +default['newrelic']['php_agent']['web_server']['service_supports'] = {:status => true, :start => true, :stop => true, :restart => true, :reload => true} default['newrelic']['php_agent']['config_file'] = nil default['newrelic']['php_agent']['config_file_to_be_deleted'] = nil default['newrelic']['php_agent']['execute_php5enmod'] = nil diff --git a/providers/agent_php.rb b/providers/agent_php.rb index f3b8562a..1f6a2c13 100644 --- a/providers/agent_php.rb +++ b/providers/agent_php.rb @@ -84,7 +84,10 @@ def newrelic_daemon def webserver_service service new_resource.service_name do - supports :status => true, :start => true, :stop => true, :restart => true, :reload => true + supports new_resource.service_supports + if new_resource.service_provider + provider eval(new_resource.service_provider) + end end end diff --git a/resources/agent_php.rb b/resources/agent_php.rb index 6e1bff14..5569354d 100644 --- a/resources/agent_php.rb +++ b/resources/agent_php.rb @@ -17,6 +17,8 @@ attribute :config_file_to_be_deleted, :kind_of => String, :default => nil attribute :service_name, :kind_of => String, :default => nil attribute :service_action, :kind_of => String, :default => 'restart' +attribute :service_provider, :kind_of => String, :default => nil +attribute :service_supports, :kind_of => Hash, :default => {:status => true, :start => true, :stop => true, :restart => true, :reload => true} attribute :execute_php5enmod, :kind_of => [TrueClass, FalseClass], :default => false attribute :cookbook_ini, :kind_of => String, :default => 'newrelic' attribute :source_ini, :kind_of => String, :default => 'agent/php/newrelic.ini.erb'