From b36e6a718ab1b6fe36fc7c25df39b464a4306a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 13 Aug 2018 12:03:59 +0200 Subject: [PATCH] Add a recipe that sets up the cluster and enables the firewall --- site-cookbooks/kosmos-ipfs/metadata.rb | 1 + site-cookbooks/kosmos-ipfs/recipes/cluster.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 site-cookbooks/kosmos-ipfs/recipes/cluster.rb diff --git a/site-cookbooks/kosmos-ipfs/metadata.rb b/site-cookbooks/kosmos-ipfs/metadata.rb index 73a6747..7578a26 100644 --- a/site-cookbooks/kosmos-ipfs/metadata.rb +++ b/site-cookbooks/kosmos-ipfs/metadata.rb @@ -9,3 +9,4 @@ version '0.1.0' depends 'ipfs' depends 'kosmos-base' depends 'kosmos-nginx' +depends 'firewall' diff --git a/site-cookbooks/kosmos-ipfs/recipes/cluster.rb b/site-cookbooks/kosmos-ipfs/recipes/cluster.rb new file mode 100644 index 0000000..a1ce6d7 --- /dev/null +++ b/site-cookbooks/kosmos-ipfs/recipes/cluster.rb @@ -0,0 +1,19 @@ +# +# Cookbook Name:: kosmos-ipfs +# Recipe:: cluster +# +# Copyright 2018, Kosmos +# +# All rights reserved - Do Not Redistribute +# + +include_recipe "ipfs::cluster" + +unless node.chef_environment == "development" + include_recipe "firewall" + firewall_rule 'ipfs_cluster' do + port 9096 + protocol :tcp + command :allow + end +end