Sha256: e640748e6917b84ae3f5fe0c58c61b0a28bac48bd8f94c4e2ef5454b7941e9ac

Contents?: true

Size: 916 Bytes

Versions: 6

Compression:

Stored size: 916 Bytes

Contents

require_relative 'box'

module VagrantMutate
  module Box
    class Libvirt < Box

      def initialize(env, name, dir)
        super
        @provider_name    = 'libvirt'
        @supported_input  = true
        @supported_output = true
        @image_format     = 'qcow2'
        @image_name       = 'box.img'
        @mac              = nil
      end

      # since none of below can be determined from the box
      # we just generate sane values

      def architecture
        return 'x86_64'
      end

      # kvm prefix is 52:54:00
      def mac_address
        unless @mac
          octets = 3.times.map { rand(255).to_s(16) }
          @mac = "525400#{octets[0]}#{octets[1]}#{octets[2]}"
        end
        return @mac
      end

      def cpus
        return 1
      end

      def memory
        return 536870912
      end

      def disk_interface
        return 'virtio'
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-mutate-0.3.2 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-0.3.1 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-0.3.0 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-0.2.6 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-0.2.5 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-0.2.4 lib/vagrant-mutate/box/libvirt.rb