Created
November 3, 2021 15:21
-
-
Save ajdecon/5d18a5c5194935c28ecd57b5d4bae948 to your computer and use it in GitHub Desktop.
Vagrantfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VAGRANTFILE_API_VERSION = "2" | |
BOX_IMAGE = "generic/ubuntu2004" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.ssh.insert_key = false | |
config.ssh.private_key_path = ["~/.ssh/id_rsa", "~/.vagrant.d/insecure_private_key"] | |
config.vm.provision "file", source: "~/.ssh/id_rsa.pub", destination: "~/.ssh/authorized_keys" | |
config.vm.define "virtual-mgmt01" do |mgmt| | |
mgmt.vm.provider "libvirt" do |v| | |
v.memory = 4096 | |
v.cpus = 4 | |
end | |
mgmt.vm.box = BOX_IMAGE | |
mgmt.vm.network :private_network, ip: "10.0.0.2" | |
end | |
config.vm.define "virtual-gpu01" do |gpu| | |
gpu.vm.provider "libvirt" do |v| | |
v.memory = 16384 | |
v.cpus = 2 | |
v.machine_type = "q35" | |
v.cpu_mode = "host-passthrough" | |
end | |
gpu.vm.box = BOX_IMAGE | |
gpu.vm.network :private_network, ip: "10.0.0.6" | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
sed -i -e 's/4\.2\.2\.1/8.8.8.8/g' -e 's/4\.2\.2\.2/8.8.4.4/g' /etc/netplan/01-netcfg.yaml | |
netplan apply | |
apt-get update | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment