From cb145c41bd62f790fb2f94769d3216a8cc6bc4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ara=C3=BAjo?= <davidaraujo@av.it.pt> Date: Mon, 8 Jul 2024 12:16:27 +0100 Subject: [PATCH] Vagrant environment --- ansible/Vagrantfile | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 ansible/Vagrantfile diff --git a/ansible/Vagrantfile b/ansible/Vagrantfile new file mode 100644 index 000000000..6dd86b0ee --- /dev/null +++ b/ansible/Vagrantfile @@ -0,0 +1,42 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.define "hub" do |hub| + hub.vm.box = "ubuntu/mantic64" + hub.vm.hostname = "hub" + hub.vm.network "private_network", ip: "192.168.56.10" + hub.vm.provider "virtualbox" do |v| + # This is high because in this scenarion, the hub will be responsible form runnin, both, TFS and Containerlab + # Other configurations between the nodes can be used, but that will require to also change the playbook + v.memory = 16384 + v.cpus = 6 + end + hub.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "/home/vagrant/.ssh/host.pub" + hub.vm.provision "shell", inline: "cat /home/vagrant/.ssh/host.pub >> /home/vagrant/.ssh/authorized_keys" + end + + config.vm.define "spoke1" do |spoke1| + spoke1.vm.box = "ubuntu/mantic64" + spoke1.vm.hostname = "spoke1" + spoke1.vm.network "private_network", ip: "192.168.56.11" + spoke1.vm.provider "virtualbox" do |v| + v.memory = 2048 + v.cpus = 1 + end + spoke1.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "/home/vagrant/.ssh/host.pub" + spoke1.vm.provision "shell", inline: "cat /home/vagrant/.ssh/host.pub >> /home/vagrant/.ssh/authorized_keys" + end + + config.vm.define "spoke2" do |spoke2| + spoke2.vm.box = "ubuntu/mantic64" + spoke2.vm.hostname = "spoke2" + spoke2.vm.network "private_network", ip: "192.168.56.12" + spoke2.vm.provider "virtualbox" do |v| + v.memory = 2048 + v.cpus = 1 + end + spoke2.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "/home/vagrant/.ssh/host.pub" + spoke2.vm.provision "shell", inline: "cat /home/vagrant/.ssh/host.pub >> /home/vagrant/.ssh/authorized_keys" + end +end -- GitLab