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 error at first run when /usr/sbin/rebuild-iptables not found #97

Closed dobromyslov closed 4 years ago

dobromyslov commented 5 years ago

Description

Fix this error. FATAL: Errno::ENOENT: execute[rebuild-iptables] (iptables::default line 38) had an error: Errno::ENOENT: No such file or directory - /usr/sbin/rebuild-iptables

default.rb recipe tries to rebuild iptables when it does not exist. I just moved rebuild execution after the script creation from the template.

devsibwarra commented 5 years ago

Seeing this issue as well on a fresh Ubuntu 16.04 install. Are you able to get this back in sync with master?

devsibwarra commented 5 years ago

@dobromyslov Dug into this further and my problem was because of a missing Ruby binary (using Chef Workstation 0.2.48). Can you confirm the Ruby binary at the top of your /usr/sbin/rebuild-iptables exists?

My file looks like

#!/opt/chef/embedded/bin/ruby -w

which is the backup value used here if the system has no Ruby installed yet

This hard-coded path should probably use node[languages][ruby][ruby_bin] from Ohai, but the refactor in #98 should make this problem go away

tas50 commented 4 years ago

I don't believe this is an issue with the rewrite so I'm going to close this out. Please do let me know if it's still a problem in the newer versions.