berkshelf / vagrant-berkshelf

A Vagrant plugin to add Berkshelf integration to the Chef provisioners
Other
379 stars 100 forks source link

Synced folder lost during halt/reload when `berkshelf_path` is in a subdir #287

Closed patcon closed 9 years ago

patcon commented 9 years ago

Files

# Berksfile
source 'https://supermarket.chef.io'

cookbook 'city-hall-api',
  path: 'cookbooks/city-hall-api'
# ...
# shell
~$ tree -L 2
.
├── Gruntfile.js
├── README.md
├── Vagrantfile
├── chef
│   ├── Berksfile
│   ├── Berksfile.lock
│   └── cookbooks
        └── city-hall-api/
etc
# Vagrantfile
Vagrant.configure(2) do |config|
  # ...
  config.berkshelf.berksfile_path = "chef/Berksfile"
  config.berkshelf.enabled = true # Required for above path to work

  config.vm.provision "chef_zero" do |chef|
    # no `cookbooks_path` config
  end
end

Problem statement

This might be two bugs:

  1. enabled = true is required in order for my berksfile_path to be recognized`
  2. issue summarized in title. Seems to work so long as I don't halt or reload, but need to destroy and bring it back if I do those things, as I start getting this:
==> toronto-city-hall-api: Mounting shared folders...
    toronto-city-hall-api: /vagrant => /non_encrypted/repos/toronto-city-hall-api
    toronto-city-hall-api: /tmp/vagrant-cache => /home/patcon/.vagrant.d/cache/ubuntu/trusty64
==> toronto-city-hall-api: Configuring cache buckets...
//... etc
==> toronto-city-hall-api: Configuring cache buckets...
==> toronto-city-hall-api: Running provisioner: chef_zero...
==> toronto-city-hall-api: Detected Chef (11.18.12) is already installed
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.

All folders sync fine the first time, but the berkshelf path doesn't resync when it comes back online

sethvargo commented 9 years ago

https://github.com/mitchellh/vagrant/issues/5199

patcon commented 9 years ago

for anyone else here, this resolved my issue: