From 4bd6bffcb6ff02e25c5bca16882bfbf4f08b0ad3 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Fri, 12 Jul 2013 20:38:38 -0300 Subject: [PATCH] Use vagrant-omnibus to test Chef provisioning on example Vagrantfile --- Gemfile | 1 + Gemfile.lock | 2 ++ example/Vagrantfile | 15 ++++++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index eef99e8..62ddf29 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index ed1f6d5..8ac4004 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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! diff --git a/example/Vagrantfile b/example/Vagrantfile index 53da8e9..179bbed 100644 --- a/example/Vagrantfile +++ b/example/Vagrantfile @@ -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