2015-07-28 4 views
18

È possibile impostare più di una cartella di sincronizzazione in un file vagrant? Ecco la mia attuale configurazione (utilizzando vaprobash):vagabondo con più cartelle sincronizzate

# Use NFS for the shared folder 
config.vm.synced_folder ".", "/vagrant/Sites", 
      id: "core", 
      :nfs => true, 
      :mount_options => ['nolock,vers=3,udp,noatime'] 

# Use NFS for the shared folder 
config.vm.synced_folder "../Code", "/vagrant/Code", 
      id: "core", 
      :nfs => true, 
      :mount_options => ['nolock,vers=3,udp,noatime'] 

Solo la seconda mappatura ottiene caricato, l'altro è ignored-- così finisco con una directory /vagrant/Code mappata correttamente, ma non vagrant/Sites

risposta

32

ho solo bisogno per impostare un ID univoco per ciascuna montatura, quindi ricaricare la scatola vagabonda.

# Use NFS for the shared folder 
config.vm.synced_folder ".", "/vagrant/Sites", 
     id: "sites", # <--- this ID must be unique 
     :nfs => true, 
     :mount_options => ['nolock,vers=3,udp,noatime'] 

# Use NFS for the shared folder 
config.vm.synced_folder "../Code", "/vagrant/Code", 
     id: "code", # <--- different from this one 
     :nfs => true, 
     :mount_options => ['nolock,vers=3,udp,noatime']