我创建了一个 debian vm,并通过 puphet 创建了一个虚拟主机,并指向它在我的主机主机文件中创建的本地 ip。但是现在当我尝试创建另一个时它不会工作。我读过其他线程,例如:
在提到使用 chef的 vagrant box 上创建虚拟主机。但我不明白的是为什么它不能正常工作?通常,我的意思是在 /etc/apache2/sites-available 中创建一个新的 vhost 文件,启用它并在我的本地计算机主机文件中创建带有 ip 的路径。厨师在做什么我不能手动做的?
这是我的流浪文件:
Vagrant.configure("2") do |config|
config.vm.box = "debian-wheezy72-x64-vbox43"
config.vm.box_url = "https://puphpet.s3.amazonaws.com/debian-wheezy72-x64-vbox43.box"
config.vm.network "private_network", ip: "192.168.56.101"
config.vm.synced_folder "/Volumes/www", "/var/www", id: "vagrant-root", :nfs => false
config.vm.usable_port_range = (2200..2250)
config.vm.provider :virtualbox do |virtualbox|
virtualbox.customize ["modifyvm", :id, "--name", "wheezyDEB"]
virtualbox.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
virtualbox.customize ["modifyvm", :id, "--memory", "512"]
virtualbox.customize ["setextradata", :id, "--VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
config.vm.provision :shell, :path => "shell/initial-setup.sh"
config.vm.provision :shell, :path => "shell/update-puppet.sh"
config.vm.provision :shell, :path => "shell/librarian-puppet-vagrant.sh"
config.vm.provision :puppet do |puppet|
puppet.facter = {
"ssh_username" => "vagrant"
}
puppet.manifests_path = "puppet/manifests"
puppet.options = ["--verbose", "--hiera_config /vagrant/hiera.yaml", "--parser future"]
end
config.ssh.username = "vagrant"
config.ssh.shell = "bash -l"
config.ssh.keep_alive = true
config.ssh.forward_agent = false
config.ssh.forward_x11 = false
config.vagrant.host = :detect
end