Open michaelglass opened 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!
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"]
...
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.
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!
librarian doesn't just kill cookbooks in /cookbooks, it killls the cookbooks directory. NFS mounts are thusly expired. halp?