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

6.0.1 using Ruby 2.4 method causing error on chef client <13 #107

Closed TimothyTitan closed 4 years ago

TimothyTitan commented 4 years ago

Cookbook version

6.0.1

Chef-client version

12.22.5

Platform Details

Centos 7

Scenario:

Add iptables onto haproxy server

Steps to Reproduce:

Cookbook with rule:

iptables_rule '01_icmp' do
    line "-A INPUT -i #{node['network']['default_interface']} -p icmp --icmp-type echo-request -j ACCEPT"
end

Expected Result:

new iptables rule defined to allow icmp

Actual Result:

Chef client run fails with error:

ERROR: iptables_rule[01_icmp] (test_icmp::default line 89) had an error: NoMethodError: undefined method `match?' for "-A INPUT -i eth0 -p icmp --icmp-type echo-request -j ACCEPT":String

Looks like match? is a new ruby 2.4 method and that isn't introduced on chef-client until version 13+ Will successfully run on 13+ but currently breaking for any 12.x server we still have running.

welcomebot commented 4 years ago

Hey There It looks like this is the first issue you've filed against the chef-cookbooks project. I'm here to offer you a bit of extra help to make sure we can quickly get back to you. Make sure you've filled out all the fields in our issue template. Make sure you've provided us with the version of chef-client you're running, your operating system and the version of the cookbook. If you're not using the most up to date version of the cookbook then please make sure to update first. Lots of things change between versions even if you're issue isn't listed in the changelog. Finally please give us a detailed description of the issue you're having. The more we know about what you're trying to do, what actually happens, and how you can reproduce the problem, the better.

If you're looking for more immediate troubleshooting help make sure to check out #general on the Chef Community Slack. There's plenty of folks there willing to lend a helping hand. Thanks for the first issue. We hope we can get back to you soon with a solution.

bmhughes commented 4 years ago

I'll submit a PR to cover this shortly.

tas50 commented 4 years ago

Closing this out at this point since we require Chef 14+. You'll need to pin to the appropriate older release to support EOL client versions.