2013-03-08 05:32:28 +00:00
|
|
|
# -*- 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|
|
2013-03-09 04:43:57 +00:00
|
|
|
config.vm.box = "lxc-quantal64-2013-03-08"
|
2013-03-08 05:32:28 +00:00
|
|
|
config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-03-08.box'
|
2013-03-09 04:43:57 +00:00
|
|
|
config.vm.hostname = "lxc-quantal64"
|
2013-03-08 05:32:28 +00:00
|
|
|
|
|
|
|
config.vm.synced_folder "../", "/vagrant", name: 'vagrant-root'
|
|
|
|
|
|
|
|
cache_dir = local_cache(config.vm.box)
|
|
|
|
config.vm.synced_folder cache_dir,
|
2013-03-09 20:51:42 +00:00
|
|
|
"/var/cache/apt/archives",
|
2013-03-08 05:32:28 +00:00
|
|
|
name: "vagrant-cache"
|
|
|
|
|
2013-03-09 05:22:52 +00:00
|
|
|
config.vm.provider :lxc do |lxc|
|
|
|
|
# Required to boot nested containers
|
|
|
|
lxc.start_opts << 'lxc.aa_profile=unconfined'
|
|
|
|
end
|
|
|
|
|
2013-03-09 19:40:42 +00:00
|
|
|
config.vm.provision :shell, :path => 'shell-provisioning/install-puppet'
|
2013-03-08 05:32:28 +00:00
|
|
|
|
|
|
|
config.vm.provision :puppet do |puppet|
|
|
|
|
puppet.manifests_path = "."
|
|
|
|
puppet.manifest_file = "site.pp"
|
|
|
|
# Pass DEBUG=1 to vagrant commands if you want to make some debugging noise
|
|
|
|
puppet.options << [ '--verbose', '--debug' ] if ENV['DEBUG'] == '1'
|
|
|
|
end
|
|
|
|
end
|