Sha256: 29e7adf5e0b177b1637528277812af8d9e24207c185dd895f8d7239b02ccd356

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

# -*- mode: ruby -*-
# vi: set ft=ruby :

def local_cache(box_name)
  cache_dir = File.join(File.expand_path(Vagrant::Environment::DEFAULT_HOME),
                        'cache',
                        'apt',
                        box_name)
  partial_dir = File.join(cache_dir, 'partial')
  FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir
  cache_dir
end

Vagrant.require_plugin 'vagrant-lxc'

Vagrant.configure("2") do |config|
  config.vm.box      = "quantal64"
  config.vm.box_url  = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-03-10.box'
  config.vm.hostname = 'lxc-quantal64'

  config.vm.synced_folder "/tmp", "/vagrant_data"

  cache_dir = local_cache(config.vm.box)
  config.vm.synced_folder cache_dir, "/var/cache/apt/archives"

  config.vm.provider :lxc do |lxc|
    lxc.start_opts << 'lxc.cgroup.memory.limit_in_bytes=400M'
    lxc.start_opts << 'lxc.cgroup.memory.memsw.limit_in_bytes=500M'
  end

  config.vm.provision :shell, :inline => <<-SCRIPT
echo "Hi there I'm a shell script used for provisioning"
  SCRIPT

  config.vm.provision :puppet do |puppet|
    puppet.module_path    = "puppet/modules"
    puppet.manifests_path = "puppet/manifests"
    puppet.manifest_file  = "site.pp"
    # If you want to make some debugging noise
    # puppet.options << [ '--verbose', '--debug' ]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-lxc-0.0.3 example/Vagrantfile
vagrant-lxc-0.0.2 example/Vagrantfile
vagrant-lxc-0.0.1 example/Vagrantfile