sous-chefs / firewall

Development repository for the firewall cookbook
https://supermarket.chef.io/cookbooks/firewall
Apache License 2.0
99 stars 150 forks source link

ufw: Add support for :raw #114

Closed ErebusBat closed 8 years ago

ErebusBat commented 8 years ago

This adds support to the ufw provider so that it actually supports the :raw command as currently documented.

Also adds an example to the README.md

chef-supermarket commented 8 years ago

Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog.

GitHub Users Who Are Not Authorized To Contribute

The following GitHub users do not appear to have signed a CLA:

Please sign the CLA here.

chef-supermarket commented 8 years ago

Hi. Your friendly Curry bot here. Just letting you know that all commit authors have become authorized to contribute. I have added the "Signed CLA" label to this issue so it can easily be found in the future.

martinb3 commented 8 years ago

Hi there -- I believe this feature is already present in the same file, with this at line 74:

return new_resource.raw.strip if new_resource.raw
ErebusBat commented 8 years ago

@martinb3 That doesn't work because of line 64 that gets called before calling into rule():

ufw_command << type.to_s

This makes it 'almost' raw, but not quite.

ErebusBat commented 8 years ago

Removed now erroneous line in rule() method.

martinb3 commented 8 years ago

Still working on this one. It's producing lines like ufw allow allow in proto tcp to any port 7788 from any on the Ubuntu test suites.

martinb3 commented 8 years ago

Had to rebase, and fix the bug with duplicate commands. Merged to master in: https://github.com/chef-cookbooks/firewall/commit/3af3c26a60212dba66cb2709b4099ee8cd754714 https://github.com/chef-cookbooks/firewall/commit/9635780856f6c021a89995b09fbc22e3cf4b2836 https://github.com/chef-cookbooks/firewall/commit/c155b7329a8b95be0360358bba8103024989f1b7