vagrantpuppetpuphpet

Vagrant can't set permissions for NFS share


I've used PuPHPet to create a manifest for a virtual machine for a project I'm currently working on.

Everything is fine up until right at the end (after "Notice: Finished catalog run in xxx.xx seconds"). It then says:

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

I have tried using regular shared folders instead but that introduced other problems, and on top of the the speed of shared folders is said to be nowhere near as good as NFS.

I'm running Ubuntu 13.10 as the host operating system and the guest is Ubuntu 12.04. The configuration is fairly standard, if necessary I can edit this to include any of the files that PuPHPet has created.

What can be done to solve this issue?


Solution

  • If /var/www is indeed an NFS mount, it must be exported with the norootsquash option (if you dare), otherwise Puppet (typically running as root) will not be able to change its permissions.

    Note that it is safer to use rootsquash and manage the NFS permissions server side.