我是一个Vagrant和Puppet新手,我使用
instructions here to install Puppet with the Puppetlabs packages创建了一个带Debian Squeeze和独立Puppet的Base Box.
盒子本身似乎成功导入但是一旦我进入配置它,我得到的错误似乎与主机上的nfs共享有关. 1000是vm上Vagrant用户的uid.
错误:
Error: Failed to set owner to '1000': Operation not permitted - /vagrant/www/index.PHP Error: /Stage[main]/Perchdemo::Sites::Create/File[/vagrant/www/index.PHP]/owner: change from 501 to vagrant Failed: Failed to set owner to '1000': Operation not permitted - /vagrant/www/index.PHP
当我使用Puppet将index.PHP文件复制到主机文件系统上的share / vagrant / www时会发生这种情况.我在vm的独立安装上使用了这个Puppet模块,其中文件托管在vm的文件系统上,理想情况下我希望它们在nfs共享上.
编辑了更多信息.当我使用puppetlabs apache模块创建vhost时,最初发生了错误.无论我尝试使用哪个用户强制创建它,它都会失败并出现相同的错误.
我的VagrantFile对此如下.
Vagrant::Config.run do |config| config.vm.Box = "squeeze64" config.vm.network :hostonly,"10.1.0.52" config.nfs.map_uid = :auto config.nfs.map_gid = :auto config.vm.forward_port 80,8080 config.vm.share_folder("v-web","/vagrant/www","./www",:nfs => true) config.vm.provision :shell,:inline => "echo \"Europe/London\" | sudo tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata" config.vm.provision :shell,:inline => "apt-get update --fix-missing" config.vm.provision :shell,:inline => "apt-get upgrade" config.vm.provision :puppet do |puppet| puppet.facter = { "fqdn" => "perchtutorial.eoms"} puppet.manifests_path = "puppet/manifests" puppet.manifest_file = "perchtutorial.pp" puppet.module_path = "puppet/modules" end end