rtkwlf / cookbook-simple-iptables

Simple Chef iptables cookbook
86 stars 63 forks source link

Default comment to name attribute #63

Closed dblessing closed 9 years ago

dblessing commented 9 years ago

By default, set the comment for a rule to the resource name. This enables simple rule creation with nice comments. Of course, if a user wants to they can still set an arbitrary resource name and specify a comment separately.

Instead of:

simple_iptables_rule 'some arbitrary thing' do
  comment 'accept all on loopback interface'
  chain 'INPUT'
  rule '--in-interface lo'
  jump 'ACCEPT'
  weight 1
end

We can now do this:

simple_iptables_rule 'accept all on loopback interface' do
  chain 'INPUT'
  rule '--in-interface lo'
  jump 'ACCEPT'
  weight 1
end
rtkrruvinskiy commented 9 years ago

@dblessing Thanks!