Use vagrant-omnibus to test Chef provisioning on example Vagrantfile

This commit is contained in:
Fabio Rehm 2013-07-12 20:38:38 -03:00
parent 0e66eb675b
commit 4bd6bffcb6
3 changed files with 13 additions and 5 deletions

View file

@ -6,6 +6,7 @@ group :development do
gem 'vagrant', github: 'mitchellh/vagrant'
gem 'vagrant-cachier', github: 'fgrehm/vagrant-cachier'
gem 'vagrant-pristine', github: 'fgrehm/vagrant-pristine'
gem 'vagrant-omnibus'
gem 'guard'
gem 'guard-rspec'
gem 'rb-inotify'

View file

@ -96,6 +96,7 @@ GEM
simplecov-html (0.7.1)
slop (3.4.5)
thor (0.18.1)
vagrant-omnibus (1.1.0)
PLATFORMS
ruby
@ -112,4 +113,5 @@ DEPENDENCIES
vagrant!
vagrant-cachier!
vagrant-lxc!
vagrant-omnibus
vagrant-pristine!

15
example/Vagrantfile vendored
View file

@ -3,6 +3,7 @@
# Not really needed, but useful while developing so that vagrant picks it up
Vagrant.require_plugin 'vagrant-lxc'
Vagrant.require_plugin 'vagrant-omnibus'
Vagrant.configure("2") do |config|
config.vm.synced_folder "/tmp", "/vagrant_data"
@ -22,11 +23,6 @@ echo "Hi there I'm a shell script used for provisioning"
puppet.manifest_file = "site.pp"
end
config.vm.provision :chef_solo do |chef|
chef.add_recipe "hello-world"
chef.log_level = :debug
end
port = 8080
releases = %w(precise quantal raring wheezy squeeze sid)
releases.each do |release|
@ -37,6 +33,15 @@ echo "Hi there I'm a shell script used for provisioning"
# lxc_config.vm.box_url = "../boxes/output/lxc-#{release}-amd64-2013-07-12.box"
lxc_config.vm.network :forwarded_port, guest: 80, host: (port += 1)
lxc_config.vm.hostname = "lxc-#{release}64-example"
if %w(precise quantal raring squeeze).include? release
lxc_config.omnibus.chef_version = :latest
lxc_config.vm.provision :chef_solo do |chef|
chef.add_recipe "hello-world"
chef.log_level = :debug
end
end
end
end
end