mirror of
https://github.com/pterodactyl/development.git
synced 2026-04-11 21:04:37 -05:00
add support for a local vagrant.settings.yml
this allows to configure some settings per-machine for now cpu and ram of the wings vm
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,3 +3,6 @@
|
||||
.data/**
|
||||
.docker-sync/**
|
||||
.idea
|
||||
|
||||
# intended for per-machine config
|
||||
vagrant.config.yml
|
||||
12
Vagrantfile
vendored
12
Vagrantfile
vendored
@@ -1,3 +1,6 @@
|
||||
require 'yaml'
|
||||
require 'pathname'
|
||||
|
||||
["vagrant-vbguest", "vagrant-hostmanager"].each do |plugin|
|
||||
unless Vagrant.has_plugin?(plugin)
|
||||
raise plugin + " plugin is not installed. Hint: vagrant plugin install " + plugin
|
||||
@@ -6,6 +9,11 @@ end
|
||||
|
||||
vagrant_root = File.dirname(__FILE__)
|
||||
|
||||
$configMap = FileTest.exist?("#{vagrant_root}/vagrant.config.yml") ? YAML.load_file("#{vagrant_root}/vagrant.config.yml") : {}
|
||||
def config(key, def_val)
|
||||
return $configMap.dig(*key.split(".")) || def_val
|
||||
end
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
config.hostmanager.enabled = false
|
||||
config.hostmanager.manage_host = true
|
||||
@@ -76,8 +84,8 @@ Vagrant.configure("2") do |config|
|
||||
wings.vm.box = "bento/ubuntu-18.04"
|
||||
|
||||
wings.vm.provider "virtualbox" do |v|
|
||||
v.memory = 2048
|
||||
v.cpus = 2
|
||||
v.memory = config("wings.memory", 2048)
|
||||
v.cpus = config("wings.cpus", 2)
|
||||
v.customize ["modifyvm", :id, "--cpuexecutioncap", "75"]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user