Sha256: 3de69f89b6b5469bddfa671c070a46f0019686c6b2c76ec38d149d9ec1516537

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

# @see http://docs.vagrantup.com/v2/vmware/configuration.html
class ConfigBuilder::Model::Provider::VMware < ConfigBuilder::Model::Provider::Base

  # @!attribute [rw] vmx
  #   @return [Hash<String, String>] A hash of VMX options for the given VM
  #   @example
  #     model.vmx = {
  #       'memsize'  => '1024',
  #       'numvcpus' => '2',
  #     }
  def_model_attribute :vmx

  # @!attribute [rw] gui
  #   @return [Boolean] Whether the GUI should be launched when the VM is created
  def_model_attribute :gui

  def initialize
    @defaults = {
      :gui => false,
      :vmx => {},
    }

    @providers ||= %w[vmware_fusion vmware_workstation]
  end

  def to_proc
    Proc.new do |vm_config|
      @providers.each do |vmware_provider|
        vm_config.provider vmware_provider do |provider, override|
          provider.gui = attr(:gui)
          attr(:vmx).each_pair do |key, value|
            provider.vmx[key] = value
          end

          eval_models([provider, override])
        end
      end
    end
  end

  ConfigBuilder::Model::Provider.register('vmware', self)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vagrant-config_builder-1.3.0 lib/config_builder/model/provider/vmware.rb
vagrant-config_builder-1.2.0 lib/config_builder/model/provider/vmware.rb
vagrant-config_builder-1.1.0 lib/config_builder/model/provider/vmware.rb
vagrant-config_builder-1.0.0 lib/config_builder/model/provider/vmware.rb
vagrant-config_builder-1.0.0.rc1 lib/config_builder/model/provider/vmware.rb