As described here, ominbus-installed chef doesn't play well with rvm. This script automates wrapping the chef binary symlinks in /usr/bin so they work again. Tested on OSX.
Last active
December 19, 2015 19:38
-
-
Save simonrobson/6007369 to your computer and use it in GitHub Desktop.
Workaround for Ominbus-installed chef not working with rvm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CHEF_DIR="/opt/chef" | |
PREFIX="/usr" | |
WRAPPER=$PREFIX/bin/chef-wrapper | |
cat > $WRAPPER <<ENDS | |
#!/bin/bash | |
unset GEM_HOME | |
unset GEM_PATH | |
ENDS | |
echo exec $CHEF_DIR/bin/\$\{0/*\\/\/\} \$* >> $WRAPPER | |
chmod +x $WRAPPER | |
ln -sf $WRAPPER $PREFIX/bin/chef-client | |
ln -sf $WRAPPER $PREFIX/bin/chef-solo | |
ln -sf $WRAPPER $PREFIX/bin/chef-apply | |
ln -sf $WRAPPER $PREFIX/bin/chef-shell | |
ln -sf $WRAPPER $PREFIX/bin/knife | |
ln -sf $WRAPPER $PREFIX/bin/shef | |
ln -sf $WRAPPER $PREFIX/bin/ohai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
unset GEM_HOME | |
unset GEM_PATH | |
exec /opt/chef/bin/${0/*\//} $* | |
(straight from linked issue, without the quoting :) Thanks Larry Gilbert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment