Merge pull request #16 from tinkerbell/vagrantfile-env-fixes-0
Vagrant virtualbox worker env override fixes
This commit is contained in:
commit
43e3fe8aaa
14
deploy/vagrant/Vagrantfile
vendored
14
deploy/vagrant/Vagrantfile
vendored
@ -1,9 +1,15 @@
|
||||
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
|
||||
|
||||
# Returns true if `GUI` environment variable is set to a non-empty value.
|
||||
# Returns true if `GUI` environment variable exists, value does not matter.
|
||||
# Defaults to false
|
||||
def worker_gui_enabled?
|
||||
ENV.fetch('VAGRANT_WORKER_GUI', '').empty?
|
||||
ENV.include?('VAGRANT_WORKER_GUI')
|
||||
end
|
||||
|
||||
# Returns true if `SCALE` environment variable exists, value does not matter.
|
||||
# Defaults to false
|
||||
def worker_display_scale_enabled?
|
||||
ENV.include?('VAGRANT_WORKER_SCALE')
|
||||
end
|
||||
|
||||
Vagrant.configure('2') do |config|
|
||||
@ -57,6 +63,10 @@ Vagrant.configure('2') do |config|
|
||||
vb.memory = 4*1024
|
||||
vb.cpus = 1
|
||||
vb.gui = worker_gui_enabled?
|
||||
vb.customize [
|
||||
'setextradata', :id,
|
||||
'GUI/ScaleFactor', '3.0'
|
||||
] if worker_display_scale_enabled?
|
||||
vb.customize [
|
||||
'modifyvm', :id,
|
||||
'--nic1', 'none',
|
||||
|
@ -95,7 +95,6 @@ func TestVagrantSetupGuide(t *testing.T) {
|
||||
|
||||
t.Logf("WorkflowID: %s", workflowID)
|
||||
|
||||
os.Setenv("VAGRANT_WORKER_GUI", "false")
|
||||
worker, err := vagrant.Up(ctx,
|
||||
vagrant.WithLogger(t.Logf),
|
||||
vagrant.WithMachineName("worker"),
|
||||
|
Loading…
Reference in New Issue
Block a user