Vagrant 流浪者启动2虚拟机';他和供给者在一起
如何配置两个Vagrant VM,每个VM都有自己的provisioner文件 例如,我想用Vagrant 流浪者启动2虚拟机';他和供给者在一起,vagrant,vagrantfile,Vagrant,Vagrantfile,如何配置两个Vagrant VM,每个VM都有自己的provisioner文件 例如,我想用sensu server.pppuppet清单启动sensu服务器vm,但用sensu客户端.pppuppet清单启动sensu客户端vm #Vagrantfile API/syntax version. Don't touch unless you know what you're doing! VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRA
sensu server.pp
puppet清单启动sensu服务器
vm,但用sensu客户端.pp
puppet清单启动sensu客户端
vm
#Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder ".", "/vagrant"
config.vm.define "sensu-server", autostart: true do |server|
server.vm.box = "ubuntu-12_04-x64-virtualbox_4_2_10-plain"
server.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box"
server.vm.hostname = 'sensu-server'
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = ["vm","/vagrant/tests"]
puppet.manifests_file = "sensu-server.pp"
end
end
config.vm.define "sensu-client", autostart: true do |client|
client.vm.box = "ubuntu-12_04-x64-virtualbox_4_2_10-plain"
client.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box"
client.vm.hostname = 'sensu-client'
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = ["vm","/vagrant/tests"]
puppet.manifests_file = "sensu-client.pp"
end
end
end
这就是我能够用来配置虚拟机的语法 sensu服务器vm首先配置一个shell配置器,然后配置3个傀儡清单配置器。 sensu客户机有一个外壳,然后是一个傀儡供应器
config.vm.define "sensu-server", primary: true, autostart: true do |server|
server.vm.box = "ubuntu-12_04-x64-virtualbox_4_2_10-plain"
server.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box"
server.vm.hostname = 'sensu-server'
server.vm.provision :shell, :path => "tests/provision_server.sh"
server.vm.provision :puppet, :manifests_path => ["vm","/vagrant/tests"], :manifest_file => "rabbitmq.pp"
server.vm.provision :puppet, :manifests_path => ["vm","/vagrant/tests"], :manifest_file => "sensu-server.pp"
server.vm.provision :puppet, :manifests_path => ["vm","/vagrant/tests"], :manifest_file => "uchiwa.pp"
end
config.vm.define "sensu-client", autostart: true do |client|
client.vm.box = "ubuntu-12_04-x64-virtualbox_4_2_10-plain"
client.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210.box"
client.vm.hostname = 'sensu-client'
client.vm.provision :shell, :path => "tests/provision_client.sh"
client.vm.provision :puppet, :manifests_path => ["vm","/vagrant/tests"], :manifest_file => "sensu-client.pp"
end