From e0aa4c5b11d7caf7d85f597f90a66143ebcbf3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Wed, 10 Apr 2019 16:33:56 +0200 Subject: [PATCH] Move the firewall rule for sockethub to its own recipe --- site-cookbooks/sockethub/recipes/_firewall.rb | 18 ++++++++++++++++++ site-cookbooks/sockethub/recipes/proxy.rb | 10 +--------- 2 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 site-cookbooks/sockethub/recipes/_firewall.rb 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']