# CentOS 6 on Bento requires the iptables modules loading

%w(ip_tables iptable_filter iptable_mangle iptable_nat).each do |mod|
  next if node['kernel']['modules'].keys.include?(mod)

  begin
    kernel_module mod do
      action :load
    end
  rescue Mixlib::ShellOut::ShellCommandFailed
    Chef::Log.warn("Failed to load kernel module #{mod}. On containers/cloud this is expected.")
  end
end

# CentOS 6 on Bento requires the iptables modules loading

%w(ip_tables iptable_filter iptable_mangle iptable_nat).each do |mod|
  next if node['kernel']['modules'].keys.include?(mod)

  kernel_module mod do
    returns [0, 1]
    action :load
  end
end

Change failed module load rescue
Change failed module load rescue

Signed-off-by: Ben Hughes <9aa707886c4be7fb94846527110e24d2d51625ce@bmhughes.co.uk>
