Up until now, I have used only one Vagrant, but now I need another set-up with the same operating system.
If you create a new vagrantfile in a different directory and do a vagrantup, the contents of the second device will somehow be adapted to both the first and second devices.
[Host Configuration]
localnginx.dev 192.168.33.10
localapache.dev 192.168.33.11
1First vagrantfile <
Vagrant.configure(2) do|config|
config.ssh.insert_key=false
config.vm.define: "localnginx.dev" do | web_config |
web_config.vm.box="bento/centos-6.8"
web_config.vm.network "private_network", ip: "192.168.33.10"
web_config.vm.synced_folder "../home/sample1", "/home/sample1/htdocs", :nfs=>{:mount_options=>["dmode=777", "fmode=644" ]}
web_config.vm.provision "ansable" do | answer |
available.playbook="site.yml"
available.inventory_path="hosts/development"
available.limit="all"
end
web_config.vm.provider "virtualbox" do | vb|
vb.name="localnginx.dev"
vb.memory="2048"
vb.customize ["modifyvm",:id, "--natdnshostresolver1", "on" ]
end
end
end
台Second vagrantfile <
Vagrant.configure(2) do|config|
config.ssh.insert_key=false
config.vm.define: "localapache.dev" do | web_config |
web_config.vm.box="bento/centos-6.8"
web_config.vm.network "private_network", ip: "192.168.33.11"
web_config.vm.synced_folder "../home/sample2", "/home/sample2/htdocs", :nfs=>{:mount_options=>["dmode=777", "fmode=644" ]}
web_config.vm.provision "ansable" do | answer |
available.playbook="site.yml"
available.inventory_path="hosts/development"
available.limit="all"
end
web_config.vm.provider "virtualbox" do | vb|
vb.name="localapache.dev"
vb.memory="2048"
vb.customize ["modifyvm",:id, "--natdnshostresolver1", "on" ]
end
end
end
[Prerequisite]
[Problems]
I've been looking for this cause for a while, but it's hard to find it, so
It would be very helpful if you could give me some advice.Thank you for your cooperation.
The reason was that the previous vagrant configuration was copied by directory, and the .vagrant
directory was also copied.
This post was posted as an individual response on the community wiki based on what @stlab wrote in the questionnaire.
© 2024 OneMinuteCode. All rights reserved.