class Vagrant::LXC::Config

Attributes

backingstore[RW]

A string that contains the backing store type used with lxc-create -B

backingstore_options[RW]

Optional arguments for the backing store, such as –fssize, –fstype, …

@return [Array]

container_name[RW]

A string to explicitly set the container name. To use the vagrant machine name, set this to :machine

customizations[R]

@return [Array]

Public Class Methods

new() click to toggle source
# File lib/vagrant-lxc/config.rb, line 21
def initialize
  @customizations = []
  @backingstore = UNSET_VALUE
  @backingstore_options = []
  @sudo_wrapper   = UNSET_VALUE
  @container_name = UNSET_VALUE
end

Public Instance Methods

backingstore_option(key, value) click to toggle source

Stores options for backingstores like lvm, btrfs, etc

# File lib/vagrant-lxc/config.rb, line 45
def backingstore_option(key, value)
  @backingstore_options << [key, value]
end
customize(key, value) click to toggle source

Customize the container by calling `lxc-start` with the given configuration overrides.

For example, if you want to set the memory limit, you can use it like: config.customize 'cgroup.memory.limit_in_bytes', '400M'

When `lxc-start`ing the container, vagrant-lxc will pass in “-s lxc.cgroup.memory.limit_in_bytes=400M” to it.

@param [String] key Configuration key to override @param [String] value Configuration value to override

# File lib/vagrant-lxc/config.rb, line 40
def customize(key, value)
  @customizations << [key, value]
end
finalize!() click to toggle source
# File lib/vagrant-lxc/config.rb, line 49
def finalize!
  @sudo_wrapper = nil if @sudo_wrapper == UNSET_VALUE
  @container_name = nil if @container_name == UNSET_VALUE
  @backingstore = "best" if @backingstore == UNSET_VALUE
  @existing_container_name = nil if @existing_container_name == UNSET_VALUE
end