-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathVagrantfile
37 lines (36 loc) · 1.48 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "ovncluster" do |ovncluster|
ovncluster.vm.box = "generic/ubuntu2004"
ovncluster.vm.network "private_network", ip: "192.168.10.20", nic_type: "virtio"
ovncluster.vm.hostname = "ovn"
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
ovncluster.vm.provision 'shell', inline: 'mkdir -p /root/.ssh'
ovncluster.vm.provision 'shell', inline: "echo #{ssh_pub_key} >> /root/.ssh/authorized_keys"
ovncluster.vm.provision 'shell', inline: "echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys", privileged: false
ovncluster.vm.provider :libvirt do |libvirt|
libvirt.driver = "kvm"
libvirt.memory = 2048
libvirt.cpus = 1
end
ovncluster.vm.provision "ansible" do |ansible|
ansible.playbook = "install-ovncluster.yml"
end
end
config.vm.define "ryu" do |ryu|
ryu.vm.box = "generic/ubuntu2004"
ryu.vm.network "private_network", ip: "192.168.10.10", nic_type: "virtio"
ryu.vm.hostname = "ryu"
ssh_pub_key = File.readlines("#{Dir.home}/.ssh/id_rsa.pub").first.strip
ryu.vm.provision 'shell', inline: "echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys", privileged: false
ryu.vm.provider :libvirt do |libvirt|
libvirt.driver = "kvm"
libvirt.memory = 2048
libvirt.cpus = 1
end
ryu.vm.provision "ansible" do |ansible|
ansible.playbook = "install-ryu-mn.yml"
end
end
end