docs: show dev VM specs dynamically

This commit is contained in:
Khue Doan
2022-01-24 21:59:25 +07:00
parent 70c1b3f385
commit 1d24035249
2 changed files with 18 additions and 4 deletions

15
metal/Vagrantfile vendored
View File

@@ -3,6 +3,14 @@ require 'yaml'
inventory = YAML.load_file(File.join(__dir__, './inventories/dev.yml'))
group_vars = YAML.load_file(File.join(__dir__, './group_vars/all.yml'))
# ANCHOR: vm_specs
# TODO This is ridiculous for a local development environment.
# After multi-env is supported, optimize it.
cpus = 4
memory = "10240"
disk_size = "256GB"
# ANCHOR_END: vm_specs
Vagrant.configure("2") do |config|
config.vm.box = "rockylinux/8"
@@ -12,15 +20,14 @@ Vagrant.configure("2") do |config|
ip = host_vars['ansible_host']
node.vm.network "public_network", ip: ip
node.vm.hostname = host
node.vm.disk :disk, size: "256GB", primary: true
node.vm.disk :disk, size: disk_size, primary: true
end
end
end
config.vm.provider "virtualbox" do |vb|
# TODO this is ridiculous for a local environment, optimize it
vb.cpus = 6
vb.memory = "10240"
vb.cpus = cpus
vb.memory = memory
end
config.vm.provision "file",