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

firewall and firewall_rule resources always updated on windows #133

Closed jkburges closed 8 years ago

jkburges commented 8 years ago

Cookbook version

2.5.0

Chef-client version

12.5.1

Platform Details

Windows server 2012r2

Scenario:

The firewall and firewall_rule resources are always updated (even if nothing has changed.

Steps to Reproduce:

With a recipe something like this:

firewall 'default'

firewall_rule 'http' do
  port 80
  protocol :tcp
end

Expected Result:

Subsequent chef runs should not update these resources if nothing has changed (IMO).

Actual Result:

They are always updated.

I can see the code at https://github.com/chef-cookbooks/firewall/blob/master/libraries/helpers_windows.rb#L100, but it appears as though this is never executed.

martinb3 commented 8 years ago

Hi @jkburges -- the firewall_rule resources simply collect data, so even when they are updated, nothing is actually changed in the system. The 'action' these resources take is simply to notify the firewall resource. I agree that the firewall resource should not show as updated. We'll have to look into why this is showing as updated, as if the same firewall_rule resources are present during each run, firewall should never show as updated.

martinb3 commented 8 years ago

Hi there -- I've made some changes to master so that the firewall resource itself won't report that it has been updated. I don't have a nice solution for the firewall_rule resource, as it always fires the action that causes the rules to accumulate into the firewall resource.