Re: config.vm.synced_folder

2,174 views
Skip to first unread message

Nasko

unread,
May 28, 2013, 10:26:09 AM5/28/13
to vagra...@googlegroups.com
Ok, I just answered my own question. Today I had to upgrade my vagrant version from 1.0.6 to 1.2.2, so I was kind of forced to transform the configuration to the new format. Here's the upgraded config:

Vagrant.configure("2") do |config|
  config.vm.box = "vagrant-precise32"
  config.vm.network :forwarded_port, guest: 80, host: 8091

    config.vm.synced_folder ".", "/vagrant", :id => "vagrant-root", :owner => "vagrant", :group => "www-data"


end

Note how the local and remote folders are with switched positions in terms of parameter positions.

Having the /vagrant folder with the same group setting as that of the apache2 process' group ensures that Apache2 can access and modify files under it, without me explicitly chmoding them to 777

HTH,
Nasko

On Monday, May 27, 2013 2:06:45 PM UTC+3, Nasko wrote:


@Nathan: Does the new syntax support all the options available to 1.0.x versions? Regarding Kay's issue, in a Vagrant 1.0.6 setup, I had been using the following configuration:

config.vm.share_folder("v-root", "/vagrant", ".", :owner => "vagrant", :group => "www-data")

I think that proper owner/group configuration is more correct, than chmoding everything to 777, as this might not be the desired effect.

Kind regards,
Atanas

Michal Gondár

unread,
Jun 17, 2013, 7:58:14 AM6/17/13
to vagra...@googlegroups.com
@Nasko: this setup will not work for different providers, as aws f.e. is using user per AWS box. f.e. AWS Ubuntu user is "ubuntu" within group "ubuntu", not "vagrant:vagrant"
Reply all
Reply to author
Forward
0 new messages