Sha256: ef571c17f4112722a76388e5c6343558177ab9dd0b530b45aba7f3b3945eeeb6

Contents?: true

Size: 890 Bytes

Versions: 7

Compression:

Stored size: 890 Bytes

Contents

require_relative 'box'

module VagrantMutate
  module Box
    class Libvirt < Box
      def initialize(env, name, version, 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
        '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
        @mac
      end

      def cpus
        1
      end

      def memory
        536_870_912
      end

      def disk_interface
        'virtio'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
vagrant-mutate-1.2.0 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-1.1.0 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-1.0.4 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-1.0.3 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-1.0.2 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-1.0.1 lib/vagrant-mutate/box/libvirt.rb
vagrant-mutate-1.0.0 lib/vagrant-mutate/box/libvirt.rb