From 909d021d43b338ef841a2990528aece28bf076c5 Mon Sep 17 00:00:00 2001 From: Tualua <32481693+Tualua@users.noreply.github.com> Date: Mon, 29 May 2023 18:49:37 +0800 Subject: [PATCH 1/2] Add support for vmware_esxi plugin vmware_esxi Vagrant plugin does not support vmx parameter and exists with error. This small change in vagrant.py fixes it. --- src/molecule_plugins/vagrant/modules/vagrant.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/molecule_plugins/vagrant/modules/vagrant.py b/src/molecule_plugins/vagrant/modules/vagrant.py index aedbffcd..7b5fb89e 100755 --- a/src/molecule_plugins/vagrant/modules/vagrant.py +++ b/src/molecule_plugins/vagrant/modules/vagrant.py @@ -261,9 +261,12 @@ {% if instance.provider == "vsphere" %} {{ instance.provider | lower }}.memory_mb = {{ instance.memory }} {{ instance.provider | lower }}.cpu_count = {{ instance.cpus }} - {% elif instance.provider.startswith('vmware_') %} + {% elif instance.provider.startswith('vmware_') and instance.provider != 'vmware_esxi' %} {{ instance.provider | lower }}.vmx['memsize'] = {{ instance.memory }} {{ instance.provider | lower }}.vmx['numvcpus'] = {{ instance.cpus }} + {% elif instance.provider == 'vmware_esxi' %} + {{ instance.provider | lower }}.guest_memsize = {{ instance.memory }} + {{ instance.provider | lower }}.guest_numvcpus = {{ instance.cpus }} {% else %} {{ instance.provider | lower }}.memory = {{ instance.memory }} {{ instance.provider | lower }}.cpus = {{ instance.cpus }} From e3d19331b4b3a1e42dc3548e1c7db730f9b6890d Mon Sep 17 00:00:00 2001 From: Dmitry Popovich <32481693+Tualua@users.noreply.github.com> Date: Thu, 8 Jun 2023 23:25:29 +0800 Subject: [PATCH 2/2] Update vagrant.py Small optimization of vmware_esxi support --- src/molecule_plugins/vagrant/modules/vagrant.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/molecule_plugins/vagrant/modules/vagrant.py b/src/molecule_plugins/vagrant/modules/vagrant.py index 7b5fb89e..1b9a3569 100755 --- a/src/molecule_plugins/vagrant/modules/vagrant.py +++ b/src/molecule_plugins/vagrant/modules/vagrant.py @@ -261,12 +261,12 @@ {% if instance.provider == "vsphere" %} {{ instance.provider | lower }}.memory_mb = {{ instance.memory }} {{ instance.provider | lower }}.cpu_count = {{ instance.cpus }} - {% elif instance.provider.startswith('vmware_') and instance.provider != 'vmware_esxi' %} - {{ instance.provider | lower }}.vmx['memsize'] = {{ instance.memory }} - {{ instance.provider | lower }}.vmx['numvcpus'] = {{ instance.cpus }} {% elif instance.provider == 'vmware_esxi' %} {{ instance.provider | lower }}.guest_memsize = {{ instance.memory }} {{ instance.provider | lower }}.guest_numvcpus = {{ instance.cpus }} + {% elif instance.provider.startswith('vmware_') %} + {{ instance.provider | lower }}.vmx['memsize'] = {{ instance.memory }} + {{ instance.provider | lower }}.vmx['numvcpus'] = {{ instance.cpus }} {% else %} {{ instance.provider | lower }}.memory = {{ instance.memory }} {{ instance.provider | lower }}.cpus = {{ instance.cpus }}