yqtfea
Last Updated: September 09, 2019
·
1.442K
· sawanoboly

Chef-solo integration with RVM.

setup chef-solo

mkdir /opt/chef-solo
cd /opt/chef-solo

rvm use @chef-solo --create
echo rvm use $rvm_env_string > .rvmrc
rvm rvmrc trust .rvmrc
cat <<'EOL' >Gemfile
source "https://rubygems.org"
gem "chef"
EOL
bundle

rvm wrapper $rvm_env_string wrap chef-solo
mkdir /opt/chef-solo/cache

cat <<"EOL" >./solo.rb
file_cache_path "/opt/chef-solo/cache"
cookbook_path ["/opt/chef-solo/solo_cookbooks"]
EOL


git clone https://github.com/{your_repository}/solo_cookbooks.git

Usage example

# under rvm context
chef-solo -c ./solo.rb -o "monit_binaries"

or

/usr/local/rvm/bin/wrap_chef-solo -c ./solo.rb -o "monit_binaries"