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

undefined method `include?' for :create:Symbol #188

Closed gr790 closed 6 years ago

gr790 commented 6 years ago

Hello,

Any Help ?

Regards, Rahul.

Cookbook version

I have below entry in my Berksfile. cookbook 'firewall', '~> 2.6.3'

Chef-client version

I am using chef Gem, and below is my bundle list.

Platform Details

It is RHEL 7.4 and it is VM.

Scenario:

I am trying to setup firewalld on my virtual machine, till now iptables is working fine, but I want to migrate to firewalld.

Steps to Reproduce:

I have this recipe which is mentioned in README.

firewall_rule '100-all_on_localhost' do
  interface 'lo'
  command :allow
  only_if { node['firewall']['allow_loopback'] }
end

firewall_rule 'ssh' do
  port 22
  command :allow
  only_if { node['firewall']['allow_ssh'] }
end

firewall 'default' do
  action :install
end

Expected Result:

I guess it should run fine.

Actual Result:

I run the recipe and it results into failure with below message. chef failed: firewall[default] had an error: NoMethodError: undefined methodinclude?' for :create:Symbol `

martinb3 commented 6 years ago

Hi there -- Chef 12.4.x or greater is required. There's some breaking changes with how actions and arrays of actions were handled before Chef 12.4.x and 12.5.x.

gr790 commented 6 years ago

Hello,

Thanks, I updated chef to 12.5+, but do you think if you could add it as dependency in gemspec file.

Rahul.

martinb3 commented 6 years ago

What Gemspec file, @gr790? It's already been declared in the cookbook metadata as 12.5 and greater.

gr790 commented 6 years ago

Hello,

I thought it is gem. My bad.I guess updating cookbook using Berks should work like, how bundle works with Gemfile..Checking dependency.

I have one more question, do you think we should have IP version flag in firewal_rule to decide ipv4 or ipv6.

Regards, Rahul.

martinb3 commented 6 years ago

No worries :) Honestly, there's a lot of work still to be done for IPv6 support -- I'm torn if it's worth trying to make rules work for both, or have separate rules or a flag to determine which applies. The syntax / considerations start to get really different with more complex rules...