Commit caf5fb2a authored by Grégoire Pineau's avatar Grégoire Pineau

bug #4 Missing probe credentials config (tucksaun)

This PR was squashed before being merged into the master branch (closes #4).

Discussion
----------

Missing probe credentials config

Probe's `server_id` and `server_token` were not in use when releasing the first version of this cookbook and so were forgotten.

Commits
-------

6fe235c2 Missing probe credentials config
parents 58fdf0a4 6fe235c2
......@@ -35,6 +35,8 @@ The following attributes are available to affect the installation/configuration
* `node['blackfire']['php']['log_level']` - Sets the logging level for the PHP extension.
* `node['blackfire']['php']['log_file']` - Sets where the PHP extension write logs.
* `node['blackfire']['php']['ini_path']` - Sets where the PHP configuration will be written.
* `node['blackfire']['php']['server_id']` - Sets the Server ID to use for probe fine-grained configuration (See https://blackfire.io/doc/configuration#probe-configuration)
* `node['blackfire']['php']['server_id']` - Sets the Server Token to use for probe fine-grained configuration (See https://blackfire.io/doc/configuration#probe-configuration)
Usage
-----
......
......@@ -9,6 +9,8 @@ default['blackfire']['php']['version'] = nil
default['blackfire']['php']['agent_timeout'] = '0.25'
default['blackfire']['php']['log_level'] = nil
default['blackfire']['php']['log_file'] = nil
default['blackfire']['php']['server_id'] = nil
default['blackfire']['php']['server_token'] = nil
if platform_family?('rhel', 'fedora')
default['blackfire']['php']['ini_path'] = '/etc/php.d/zz-blackfire.ini'
......
......@@ -33,7 +33,9 @@ template node[cookbook_name]['php']['ini_path'] do
'agent_timeout' => node[cookbook_name]['php']['agent_timeout'],
'log_file' => node[cookbook_name]['php']['log_file'],
'log_level' => node[cookbook_name]['php']['log_level'],
'socket' => node[cookbook_name]['agent']['socket']
'socket' => node[cookbook_name]['agent']['socket'],
'server_id' => node[cookbook_name]['php']['server_id'],
'server_token' => node[cookbook_name]['php']['server_token']
)
notifies :run, 'ruby_block[blackfire-php-restart-webserver]', :immediately
end
......@@ -3,8 +3,16 @@
extension=blackfire.so
blackfire.agent_socket = <%= @socket %>
blackfire.agent_timeout = <%= @agent_timeout %>
<% if @server_id %>
blackfire.server_id = <%= @server_id %>
<% else %>
;blackfire.server_id =
<% end %>
<% if @server_token %>
blackfire.server_token = <%= @server_token %>
<% else %>
;blackfire.server_token =
<% end %>
<% if @log_level %>
blackfire.log_level = <%= @log_level %>
<% else %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment