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

fix so rebuild-iptables only runs once #62

Closed lamont-granquist closed 8 years ago

lamont-granquist commented 8 years ago

closes #61

uses the fact that resource notifications now bubble up to outer run_context also uses the new resource_collection editing features both of those features should have been in compat_resource for some time now

Signed-off-by: Lamont Granquist lamont@scriptkiddie.org

lamont-granquist commented 8 years ago

working on a test....

lamont-granquist commented 8 years ago

added a test, don't think it really tests this but add some use cases around nested resources, its difficult to setup an expectation that the execute resource would have only been run once, and chefspec is terribad about testing this kind of thing because it doesn't do use_inline_resources-style sub-resource collections properly.

new tests are also busted on centos-5 because, i think, serverspec doesn't support correctly testing iptables rules and inspec'ing this cookbook is a bridge too far. it looks like the other kitchen tests have a workaround for this, but it didn't work when i tried it, so fuck that. also busted on a few other boxes that fail to boot up under kitchen-vagrant at all. sigh...

lamont-granquist commented 8 years ago

@tas50 fixes the delayed notification bug

this is an accumulator-ish pattern (doesn't really require a true accumulator because /etc/iptables.d accumulates state)