chef-cookbooks / iptables

Development repository for Chef Cookbook iptables
https://supermarket.chef.io/cookbooks/iptables
Apache License 2.0
102 stars 141 forks source link

Refactor rule resource to use accumulator #98

Closed bmhughes closed 4 years ago

bmhughes commented 5 years ago

OK here it is, this ended up going further than I initially thought and I think I've touched pretty much all of the cookbook so please go easy on me if I've gone a little far.

Looking at the current open issues, these changes resolve and/or mitigate at least 3 maybe all 4 of them as well.

The rule (and by virtue rule6) resource has been majorly refactored to use an accumulated template resource to generate the persistent rules file for both iptables and ip6tables in a more 'chefy' way.

The generator script and ip(6)tables.d directories are no longer needed and have been removed from the cookbook.

The new resources can be used in a similar way to the previous ones by feeding it a full iptables rule statement, or by settings the resource properties and allowing it to generate the final statement.

In addition, a chain(6) resource has been added to allow the 'chefy' generation of iptables chains for rules to be assigned.

Signed-off-by: Ben Hughes bmhughes@bmhughes.co.uk

Description

The rule resource (and the cookbook) has been refactored to use an accumulated template resource to generate the persistent rule files rather than using the directory and script method as before.

Issues Resolved

Check List

bmhughes commented 4 years ago

I've rebased on the current master and also added support for CentOS 8.

Is there anything else I need to do/comments so that we could look towards getting this merged?