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

shebang line in rebuild-iptables script is not system-independent #18

Closed WattsInABox closed 8 years ago

WattsInABox commented 10 years ago

There's a semi-complicated bit of code to apply a different shebang line depending on where ruby is located in the system. IMO, it should just use

#!/usr/bin/env ruby
szechyjs commented 9 years ago

:+1:

at the very least, an attribute should be exposed to set the shebang line.

pghalliday commented 9 years ago

Indeed, currently this doesn't work when using chefdk :(

pghalliday commented 8 years ago

I found another case where it broke - I installed ruby from source on an ARM device and it was installed to /usr/local/bin/ruby. I don't want to change it now as it is in my base image which takes hours to build. Also as there is no Chef omnibus installer for ARM devices I installed chef as a Gem. Thus I have no embedded ruby.

The result is now that I want to configure some port forwarding on a number of devices with this cookbook, it doesn't work because ruby is in neither of the 2 places it looks. It is registered to work correctly with /usr/bin/env ruby though.

An attribute or the last solution from @billywatson suggested in the closed pull request #19 would work I think

pghalliday commented 8 years ago

I couldn't get the /usr/bin/env solution to work on my system but have just opened a pull request which adds an attribute for the system ruby path, #60

iennae commented 8 years ago

This has been resolved with PR #60. Thanks @pghalliday for the contribution!