Unverified Commit 53836280 authored by Tugdual Saunier's avatar Tugdual Saunier

minor #9 Prevent restart with no server credentials which causes exit code 1 (Zaid Daba'een)

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

Discussion
----------

Prevent restart with no server credentials which causes exit code 1

This is a solution for someone who wants to install blackfire without setting the server credentials right away, such as in public vagrant boxes. Prior to this, on server restart, chef-solo would exit due to exit code 1 from the service restart operation, and the provisioning would fail.

Commits
-------

b899e467 Prevent restart with no server credentials which causes exit code 1
parents a6c166d0 b899e467
......@@ -31,6 +31,8 @@ template '/etc/blackfire/agent' do
end
service 'blackfire-agent' do
not_if { node[cookbook_name]['agent']['server_id'].to_s.empty? }
not_if { node[cookbook_name]['agent']['server_token'].to_s.empty? }
supports status: true, start: true, stop: true, restart: true
action [:enable]
subscribes :restart, 'template[/etc/blackfire/agent]', node[cookbook_name]['agent']['restart_mode']
......
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