jimmycuadra / vagrant-librarian-chef

*UNMAINTAINED* A Vagrant plugin to install Chef cookbooks using Librarian-Chef.
MIT License
78 stars 15 forks source link

doesn't work with nfs #15

Open michaelglass opened 10 years ago

michaelglass commented 10 years ago

librarian doesn't just kill cookbooks in /cookbooks, it killls the cookbooks directory. NFS mounts are thusly expired. halp?

jimmycuadra commented 10 years ago

I just tried using NFS for the Chef Solo provisioner on a small sample project and didn't have any errors. Could you provide more information about the setup you have that's not working? Perhaps a Vagrantfile, the directory structure of your project, your Cheffile, the command you're running, and the output of the command that's not working. Thanks!

michaelglass commented 10 years ago

specifically: vagrant up: works like a charm vagrant provision later in the vagrant box's life doesn't work because librarian deletes the cookbooks directory and recreates it, thus invalidating the nfs mount point.
I've been using vagrant reload --provision instead as a workaround.

relevant vagrantfile:

...
config.librarian_chef.cheffile_dir = CHEF_DIRECTORY

config.vm.provision :chef_solo do |chef|
  chef.nfs = true

  chef.cookbooks_path = ["#{CHEF_DIRECTORY}/cookbooks", 
                         "#{CHEF_DIRECTORY}/site-cookbooks"]
...
jimmycuadra commented 10 years ago

When you're calling vagrant provision, have you changed the Librarian-managed cookbooks since the VM was booted? We could simply have the plugin do nothing in the case where the VM is already booted and the cookbooks are mounted with NFS. It'd probably be best to output a warning that vagrant reload --provision is necessary when using NFS. Would that be sufficient? I don't know much about the NFS aspect, myself, so I'm not sure if there's a way to remount the cookbooks directory without reloading the VM.

michaelglass commented 10 years ago

Ideally: instead of deleting the cookbooks directory, librarian would delete the contents of the cookbooks directory.

But the warning approach would be a cheap & acceptable fix in the mean time. Thanks!