Browse files

Open firewall

  • Loading branch information...
1 parent d5be0d9 commit d52ff99b7015191c6dbb2103c49dfa6160a24d6d @gondoi gondoi committed Jan 11, 2013
Showing with 37 additions and 1 deletion.
  1. +3 −0 attributes/firewall.rb
  2. +1 −1 metadata.rb
  3. +33 −0 recipes/firewall.rb
View
3 attributes/firewall.rb
@@ -0,0 +1,3 @@
+default['drupal']['firewall']['http'] = 80
+default['drupal']['firewall']['https'] = 443
+default['drupal']['firewall']['interface'] = "eth0"
View
2 metadata.rb
@@ -9,7 +9,7 @@
recipe "drupal::cron", "Sets up the default drupal cron"
recipe "drupal::drush", "Installs drush - a command line shell and scripting interface for Drupal"
-%w{ postfix php apache2 mysql openssl }.each do |cb|
+%w{ postfix php apache2 mysql openssl firewall }.each do |cb|
depends cb
end
View
33 recipes/firewall.rb
@@ -0,0 +1,33 @@
+#
+# Cookbook Name:: drupal
+# Recipe:: firewall
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+include_recipe "firewall"
+include_recipe "drupal"
+
+firewall_rule "http" do
+ port node['drupal']['firewall']['http']
+ protocol :tcp
+ interface node['drupal']['firewall']['interface']
+ action :allow
+end
+
+firewall_rule "https" do
+ port node['drupal']['firewall']['https']
+ protocol :tcp
+ interface node['drupal']['firewall']['interface']
+ action :allow
+end

0 comments on commit d52ff99

Please sign in to comment.