Vagrant无法为NFS共享设置权限

时间:2013-11-26 13:00:55

标签: vagrant puppet puphpet

我已经使用PuPHPet为我正在处理的项目创建虚拟机的清单。

一切都很好,直到最后(在“通知:完成的目录在xxx.xx秒内运行”之后)。然后说:

Stderr from the command:

stdin: is not a tty
Warning: Could not retrieve fact fqdn
Error: Failed to set owner to '0': Operation not permitted - /var/www
Error: /Stage[main]//File[/var/www]/owner: change from vagrant to root failed: Failed to set owner to '0': Operation not permitted - /var/www
Error: Failed to set group to '33': Operation not permitted - /var/www
Error: /Stage[main]//File[/var/www]/group: change from vagrant to www-data failed: Failed to set group to '33': Operation not permitted - /var/www
Warning: /Stage[main]//Apache::Vhost[ARbCsyrS6ueR]/File[/var/www/12_PHP_david_wright_images/src/web]: Skipping because of failed dependencies
Warning: /Stage[main]/Apache/Apache::Vhost[default]/File[15-default.conf]: Skipping because of failed dependencies
Warning: /Stage[main]//Apache::Vhost[ARbCsyrS6ueR]/File[25-ARbCsyrS6ueR.conf]: Skipping because of failed dependencies
Warning: /Stage[main]//Apache::Vhost[ARbCsyrS6ueR]/File[25-ARbCsyrS6ueR.conf symlink]: Skipping because of failed dependencies
Warning: /Stage[main]/Apache/Apache::Vhost[default]/File[15-default.conf symlink]: Skipping because of failed dependencies
Warning: /Stage[main]/Apache::Service/Service[httpd]: Skipping because of failed dependencies

我尝试过使用普通的共享文件夹,但这引入了其他问题,而且据说共享文件夹的速度远不及NFS。

我正在运行Ubuntu 13.10作为主机操作系统,而guest是Ubuntu 12.04。配置是相当标准的,如果有必要,我可以编辑它以包含PuPHPet创建的任何文件。

可以采取哪些措施来解决这个问题?

2 个答案:

答案 0 :(得分:1)

如果/var/www确实是NFS挂载,则必须使用norootsquash选项导出(如果你敢),否则Puppet(通常以root身份运行)将无法更改其权限。

请注意,使用rootsquash并管理NFS权限服务器端更安全。

答案 1 :(得分:0)

使用PuPHPet我遇到了同样的问题。解决方案是让我改变puphpet / vagrant / Vagrant-local中的152行看起来像这样

        machine_id.bindfs.bind_folder "/mnt/vagrant-#{i}", "#{folder['target']}",
          after: :synced_folders,

改变"""值为" synced_folders"为我做了诀窍。 不要忘记完成重建你的流浪机器" vagrant destroy"和"流浪"

相关问题