diff --git a/site-cookbooks/sockethub/attributes/default.rb b/site-cookbooks/sockethub/attributes/default.rb index c3a9599..5d74c1a 100644 --- a/site-cookbooks/sockethub/attributes/default.rb +++ b/site-cookbooks/sockethub/attributes/default.rb @@ -2,3 +2,4 @@ node.default['sockethub']['port'] = '10551' node.default['sockethub']['external_port'] = '10550' node.default['sockethub']['version'] = '3.1.4' node.default['sockethub']['nginx']['server_name'] = 'sockethub.kosmos.org' +node.default['sockethub']['debug_logs'] = 'sockethub*' diff --git a/site-cookbooks/sockethub/recipes/default.rb b/site-cookbooks/sockethub/recipes/default.rb index 156ada0..052a927 100644 --- a/site-cookbooks/sockethub/recipes/default.rb +++ b/site-cookbooks/sockethub/recipes/default.rb @@ -48,6 +48,15 @@ execute "systemctl daemon-reload" do action :nothing end +environment_variables = { + 'PORT' => node['sockethub']['port'], + # Use the second database (index starts at 0) + 'REDIS_URL' => "redis://localhost:6379/1" +} +unless node['sockethub']['debug_logs'].nil? + environment_variables['DEBUG'] = node['sockethub']['debug_logs'] +end + template "/lib/systemd/system/sockethub_nodejs.service" do source 'nodejs.systemd.service.erb' owner 'root' @@ -57,10 +66,7 @@ template "/lib/systemd/system/sockethub_nodejs.service" do user: "sockethub", group: "sockethub", entry: "/usr/bin/sockethub", - environment: { 'DEBUG' => '*', - 'PORT' => node['sockethub']['port'], - # Use the second database (index starts at 0) - 'REDIS_URL' => "redis://localhost:6379/1" } + environment: environment_variables ) notifies :run, "execute[systemctl daemon-reload]", :delayed notifies :restart, "service[sockethub_nodejs]", :delayed