chef-cookbooks / iptables

Development repository for Chef Cookbook iptables

Home Page:https://supermarket.chef.io/cookbooks/iptables

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Specifying a table with 'lines'

marcantonio opened this issue · comments

Cookbook version

4.0.1

Chef-client version

12.16.42

Platform Details

Ubuntu 16.04 in AWS

Scenario:

Is there a way to specify a table when using lines rather than a template?

If not something like the following would be great:

iptables_rule 'foo' do
  lines '-I PREROUTING -p tcp -m tcp --syn --dport 80 -j CT --notrack'
  table :raw
end

Looks like you can achieve this with:

lines "*nat\n-A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080"

Seems a little hacky though. I included #76 to provide the table property for use with lines. I'll provide tests if you're interested in this approach.

This is resolved with #76. Thanks!