diff --git a/lib/poise_application_ruby/resources/unicorn.rb b/lib/poise_application_ruby/resources/unicorn.rb index 1d22f7c..92d4294 100644 --- a/lib/poise_application_ruby/resources/unicorn.rb +++ b/lib/poise_application_ruby/resources/unicorn.rb @@ -51,6 +51,7 @@ class Resource < Chef::Resource # @!attribute port # Port to bind to. attribute(:port, kind_of: [String, Integer], default: 80) + attribute(:config_path, kind_of: String) end # Provider for `application_unicorn`. @@ -79,7 +80,10 @@ def configru_path # Set service resource options. def service_options(resource) super - resource.ruby_command("unicorn --port #{new_resource.port} #{configru_path}") + cmd = "unicorn --port #{new_resource.port}" + cmd << " --config-file #{::File.expand_path(new_resource.config_path, new_resource.path)}" if new_resource.config_path + cmd << " #{configru_path}" + resource.ruby_command(cmd) end end end