From 71965a04ad9f726a5bb0080ca0265894dc5815f2 Mon Sep 17 00:00:00 2001 From: Jacob Reynolds Date: Wed, 10 Aug 2016 17:34:15 -0700 Subject: [PATCH 1/2] Add a 'host' method to the application_rackup resource --- lib/poise_application_ruby/resources/rackup.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/poise_application_ruby/resources/rackup.rb b/lib/poise_application_ruby/resources/rackup.rb index bffc073..5e8708a 100644 --- a/lib/poise_application_ruby/resources/rackup.rb +++ b/lib/poise_application_ruby/resources/rackup.rb @@ -33,6 +33,7 @@ class Resource < Chef::Resource # TCP port to listen on. Defaults to 80. # @return [String, Integer] attribute(:port, kind_of: [String, Integer], default: 80) + attribute(:host, kind_of: [String], default: '127.0.0.1') end class Provider < Chef::Provider @@ -59,7 +60,7 @@ def configru_path # @return [void] def service_options(resource) super - resource.ruby_command("rackup --port #{new_resource.port}") + resource.ruby_command("rackup --port #{new_resource.port} --host #{new_resource.host}") resource.directory(::File.dirname(configru_path)) # Older versions of rackup ignore all signals. resource.stop_signal('KILL') From f7365b846f573e3e1e5a5cbf620c840f0d14acb4 Mon Sep 17 00:00:00 2001 From: Jacob Reynolds Date: Wed, 10 Aug 2016 18:22:17 -0700 Subject: [PATCH 2/2] Update README to include application_rackup host option --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1dca523..dc74b8c 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ The `application_rackup` resource creates a service for `rackup`. application '/srv/myapp' do rackup do port 8000 + host '0.0.0.0' end end ``` @@ -78,8 +79,9 @@ end * `path` – Base path for the application. *(name attribute)* * `port` – Port to listen on. *(default: 80)* +* `host` – Host address to listen on. *(default: '127.0.0.1')* * `service_name` – Name of the service to create. *(default: auto-detect)* -# `user` – User to run the service as. *(default: application owner)* +* `user` – User to run the service as. *(default: application owner)* ### `application_rails`