diff --git a/README.md b/README.md index 02c24b1..49a401d 100644 --- a/README.md +++ b/README.md @@ -68,10 +68,6 @@ Vagrant.configure("2") do |config| config.vm.box = "lxc-quantal64" config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-03-08.box' - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network :private_network, ip: "192.168.33.10" - # Share an additional folder to the guest Container. The first argument # is the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third @@ -126,11 +122,12 @@ ready for development: ```sh bundle install cd development -cp Vagrantfile.lxc Vagrantfile +cp Vagrantfile.1.1 Vagrantfile # Required in order to allow nested containers to be started sudo apt-get install apparmor-utils sudo aa-complain /usr/bin/lxc-start -bundle exec vagrant-lxc up +bundle exec vagrant-lxc up lxc --provider=lxc +bundle exec vagrant-lxc ssh lxc ``` That should result in a container ready to be `bundle exec vagrant-lxc ssh`ed. @@ -144,18 +141,20 @@ start nested containers there to try things out. ``` cd development -cp Vagrantfile.vb.1.0 Vagrantfile +cp Vagrantfile.1.0 Vagrantfile vagrant up vagrant reload +vagrant ssh ``` ### Using VirtualBox and Vagrant 1.1 for development ``` cd development -cp Vagrantfile.vb.1.1 Vagrantfile -bundle exec vagrant-lxc up -bundle exec vagrant-lxc reload +cp Vagrantfile.1.1 Vagrantfile +bundle exec vagrant-lxc up vbox +bundle exec vagrant-lxc reload vbox +bundle exec vagrant-lxc ssh vbox ``` diff --git a/development/Vagrantfile.vb.1.0 b/development/Vagrantfile.1.0 similarity index 100% rename from development/Vagrantfile.vb.1.0 rename to development/Vagrantfile.1.0 diff --git a/development/Vagrantfile.1.1 b/development/Vagrantfile.1.1 new file mode 100644 index 0000000..f924a1b --- /dev/null +++ b/development/Vagrantfile.1.1 @@ -0,0 +1,55 @@ +# -*- 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.synced_folder "../", "/vagrant", name: 'vagrant-root' + + cache_dir = local_cache(config.vm.box) + config.vm.synced_folder cache_dir, "/var/cache/apt/archives", name: "vagrant-cache" + + config.vm.define :vbox do |vb_config| + vb_config.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" + vb_config.vm.hostname = 'vbox' + + vb_config.vm.provider :virtualbox do |vb| + # Configure VM to use 1.5gb of ram and 3 cpus + vb.customize [ + "modifyvm", :id, + "--memory", '1536', + "--cpus", '4' + ] + end + + vb_config.vm.provision :shell, :path => 'shell-provisioning/upgrade-kernel' + end + + config.vm.define :lxc do |lxc_config| + lxc_config.vm.hostname = 'lxc-dev-box' + lxc_config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-03-10.box' + + lxc_config.vm.provider :lxc do |lxc| + # Required to boot nested containers + lxc.start_opts << 'lxc.aa_profile=unconfined' + end + end + + config.vm.provision :puppet do |puppet| + puppet.manifests_path = "." + puppet.manifest_file = "site.pp" + puppet.options << [ '--verbose', '--debug' ] + end +end diff --git a/development/Vagrantfile.lxc b/development/Vagrantfile.lxc deleted file mode 100644 index 46f1698..0000000 --- a/development/Vagrantfile.lxc +++ /dev/null @@ -1,38 +0,0 @@ -# -*- 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 = "lxc-quantal64-2013-03-10" - config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-03-10.box' - - config.vm.synced_folder "../", "/vagrant", name: 'vagrant-root' - - cache_dir = local_cache(config.vm.box) - config.vm.synced_folder cache_dir, - "/var/cache/apt/archives", - name: "vagrant-cache" - - config.vm.provider :lxc do |lxc| - # Required to boot nested containers - lxc.start_opts << 'lxc.aa_profile=unconfined' - end - - 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 diff --git a/development/Vagrantfile.vb.1.1 b/development/Vagrantfile.vb.1.1 deleted file mode 100644 index 12218ff..0000000 --- a/development/Vagrantfile.vb.1.1 +++ /dev/null @@ -1,31 +0,0 @@ -# -*- 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.configure('2') do |config| - config.vm.box = "quantal64" - config.vm.box_url = "https://github.com/downloads/roderik/VagrantQuantal64Box/quantal64.box" - - config.vm.synced_folder "../", "/vagrant", name: 'vagrant-root' - - cache_dir = local_cache(config.vm.box) - config.vm.synced_folder cache_dir, "/var/cache/apt/archives" - - 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