Vagrant Berkshelf - Shelf Path?

微笑、不失礼 提交于 2020-01-04 02:20:29

问题


Is it possible to set the path where the berkshelf plugin puts the cookbooks it installs? (As in the .berkshelf folder)

I am running Windows 7.

I am currently trying to install a mysql server using an opscode cookbook to a vm and here at work they have the %HOMEDRIVE% system variable set to a network drive. So when .berkshelf starts at the beginning of the Vagrantfile, it pushes the cookbooks to the network drive and it causes it to be slow and well, its not where it should be. Is there a fix to this?

VirtualBox did this as well, but I fixed it by altering the settings. I tried looking for some sort of equivalent settings for berkshelf, but the closest I got was for the standard berkshelf (thats not a vagrant plugin), it appears you can set this environment variable:

ENV['BERKSHELF_PATH']

Found here:

http://www.rubydoc.info/github/RiotGames/berkshelf/Berkshelf#berkshelf_path-class_method

I need to be able to have the cookbooks it reads from the berksfile store to my laptops local drive instead, as in my scenario I cannot have the mobility of the VM limited to the building because of files that are stored on the network.

Any incite would be much appreciated.

Perhaps its better to use the actual berkshelf over the vagrant plugin?

Thanks.


回答1:


If you want to have the portability - a full chef-repo ready for chef-solo runs, better off using standalone berkshelf instead of the vagrant-berkshelf plugin - which is NOT that flexibly.

For complex cookbooks, I prefer to use standalone berkshelf as it allows me to do berks install --path chef/cookbooks to copy all cookbooks required from ~/.berkshelf/cookbooks, then I can just tar the whole thing and transfer to other machines for the same chef-solo run. some people use capistrano automate the tar and scp/rsync over the network. I just use rysnc/scp;-)

HTH



来源:https://stackoverflow.com/questions/18773700/vagrant-berkshelf-shelf-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!