Sha256: 8531709a27c597ae513a5acf5cf3f60d1dba2d22d4911f1ea1851a25e2d6f420

Contents?: true

Size: 993 Bytes

Versions: 6

Compression:

Stored size: 993 Bytes

Contents

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-lxc-0.4.0 lib/vagrant-lxc/config.rb
vagrant-lxc-0.3.4 lib/vagrant-lxc/config.rb
vagrant-lxc-0.3.3 lib/vagrant-lxc/config.rb
vagrant-lxc-0.3.2 lib/vagrant-lxc/config.rb
vagrant-lxc-0.3.1 lib/vagrant-lxc/config.rb
vagrant-lxc-0.3.0 lib/vagrant-lxc/config.rb