How to control the version of Chef that Vagrant uses to provision VMs?

后端 未结 6 1147
眼角桃花
眼角桃花 2020-12-07 08:26

A current Chef recipe isn\'t running because of a bug in version 0.10.10. How can I upgrade the version of Chef that Vagrant uses, to 0.10.12?

I don\'t want to just

6条回答
  •  清歌不尽
    2020-12-07 09:22

    Add the lines

    config.vm.provision :shell, :inline => 'apt-get install build-essential ruby1.9.1-dev --no-upgrade --yes'
    config.vm.provision :shell, :inline => "gem install chef --version 11.4.2 --no-rdoc --no-ri --conservative"
    

    to your Vagrantfile before your config.vm.provision :chef_solo block.

    props to hauraki's comment on http://dougireton.com/blog/2012/12/23/automatically-upgrading-chef-client-on-vagrant-up/

    edited to include Jason Mayfield's comment. Make sure and give him an upvote too. I added --no-upgrade to speed things up and match the --conservative on the second line. You could instead do what Jason did, and remove both the --no-upgrade and --conservative.

    edited to include suggested edit by anonymous user228653

提交回复
热议问题