Closed nathan-lochala closed 8 years ago
I have a test cookbook that include the iptables cookbook. In my default recipe I have included the following:
include_recipe 'iptables' iptables_rule 'http_8080' do lines '-A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080' action :enable end
When I converge, lines is interpreted as a method and can't resolve. Therefore the converge fails.
================================================================================ Recipe Compile Error in /tmp/kitchen/cache/cookbooks/my_test/recipes/default.rb ================================================================================ NoMethodError ------------- undefined method `lines' for Custom resource iptables_rule from cookbook iptables Cookbook Trace: --------------- /tmp/kitchen/cache/cookbooks/my_test/recipes/default.rb:10:in `block in from_file' /tmp/kitchen/cache/cookbooks/my_test/recipes/default.rb:9:in `from_file' Relevant File Content: ---------------------- /tmp/kitchen/cache/cookbooks/my_test/recipes/default.rb: 3: # Recipe:: default 4: # 5: # Copyright (c) 2016 The Authors, All Rights Reserved. 6: 7: include_recipe 'iptables' 8: 9: iptables_rule 'http_8080' do 10>> lines '-A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080' 11: action :enable 12: end 13:
lines is not yet defined in the supermarket version. Github master branch has not yet been released to supermarket.
lines
I have a test cookbook that include the iptables cookbook. In my default recipe I have included the following:
When I converge, lines is interpreted as a method and can't resolve. Therefore the converge fails.