diff --git a/site-cookbooks/sockethub/recipes/_firewall.rb b/site-cookbooks/sockethub/recipes/_firewall.rb new file mode 100644 index 0000000..ed048e5 --- /dev/null +++ b/site-cookbooks/sockethub/recipes/_firewall.rb @@ -0,0 +1,18 @@ +# +# Cookbook Name:: sockethub +# Recipe:: _firewall +# +# Copyright 2015-2019, Kosmos +# +# All rights reserved - Do Not Redistribute +# + +unless node.chef_environment == "development" + include_recipe "firewall" + firewall_rule 'sockethub' do + port node['sockethub']['external_port'].to_i + protocol :tcp + command :allow + end +end + diff --git a/site-cookbooks/sockethub/recipes/proxy.rb b/site-cookbooks/sockethub/recipes/proxy.rb index bf63e79..520e66f 100644 --- a/site-cookbooks/sockethub/recipes/proxy.rb +++ b/site-cookbooks/sockethub/recipes/proxy.rb @@ -7,15 +7,7 @@ # All rights reserved - Do Not Redistribute # -unless node.chef_environment == "development" - include_recipe "firewall" - firewall_rule 'sockethub' do - port node['sockethub']['external_port'].to_i - protocol :tcp - command :allow - end -end - +include_recipe 'sockethub::_firewall' include_recipe 'kosmos-nginx' server_name = node['sockethub']['nginx']['server_name']