vagrant-lxc-ng/lib/vagrant-lxc/config.rb
2013-04-05 22:10:49 -03:00

31 lines
993 B
Ruby

module Vagrant
module LXC
class Config < Vagrant.plugin("2", :config)
# An array of container's configuration overrides to be provided to `lxc-start`.
#
# @return [Array]
attr_reader :customizations
def initialize
@customizations = []
end
# 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
def customize(key, value)
@customizations << [key, value]
end
# TODO: At some point in the future it would be nice to validate these options
end
end
end