From a57e654bc4323280fc8525c66900dd3f8f89a205 Mon Sep 17 00:00:00 2001 From: Christoph Maser Date: Fri, 31 Oct 2014 12:50:04 +0100 Subject: [PATCH] load rules on reboot for rhel >=7 On platform_family rhel >= 7 install iptables-services package and enable/start the services. That ways rules are loaded on boot. --- recipes/default.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/recipes/default.rb b/recipes/default.rb index 70e7325..757c0b0 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -125,6 +125,16 @@ content "#!/bin/bash\nip#{v}tables-restore < #{iptable_rules}\n" action :create end + when 'rhel' + if node['platform_version'].to_i >= 7 + package "iptables-services" + service "iptables" do + action [ :enable, :start ] + end + service "ip6tables" do + action [ :enable, :start ] + end + end end end