vagrant-lxc-ng/development/Vagrantfile.1.0
David Schoen f9d118840b set hostname for 1.0 as required by provisioning
In a fresh checkout:

    $ ( cd development; ln -s Vagrantfile{.1.0,}; vagrant up )

Was failing with:

    err: /Stage[main]//Exec[config-lxc]/returns: change from notrun to 0
    failed: cp /vagrant/development/lxc-configs/quantal64 /etc/default/lxc
    returned 1 instead of one of [0] at
    /tmp/vagrant-puppet/manifests/site.pp:19

because the hostname was "quantal64" and the puppet manifest attempts to
install the lxc-config based on the hostname name of the VM.
2013-03-15 09:16:50 +11:00

36 lines
1.2 KiB
Ruby

# -*- 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::Config.run do |config|
config.vm.box = "quantal64"
config.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box"
config.vm.host_name = 'lxc-dev-box'
cache_dir = local_cache(config.vm.box)
config.vm.share_folder "v-root", "/vagrant", "../"
config.vm.share_folder "v-cache", "/var/cache/apt/archives", cache_dir
if defined? VagrantVbguest::Config
config.vbguest.auto_update = false
config.vbguest.no_remote = true
end
config.vm.provision :shell, :path => 'shell-provisioning/upgrade-kernel'
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