[chef] Re: Re: Re: Is Berkshelf vagrant plugin are usable only with a application cookbooks instead of pure site cookbooks ?


Chronological Thread 
  • From: Eduardo Dias < >
  • To:
  • Subject: [chef] Re: Re: Re: Is Berkshelf vagrant plugin are usable only with a application cookbooks instead of pure site cookbooks ?
  • Date: Wed, 30 Oct 2013 11:05:20 -0200

You need to download a box (like ubuntu), create a vagrant file, and vagrant up.
vagrant box add <name> <url> (look at Vagrant to get the corerct url)

Simple Vargrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.hostname = "<server_name>"
  config.vm.box = "<box_name>"
  config.berkshelf.enabled = true

# the lines below is to forward ports
  config.vm.network :forwarded_port, host: 8080, guest: 8080
  config.vm.network :forwarded_port, host: 8443, guest: 8443

# the line below must be used if you need to sync a local directory with the remote
  config.vm.synced_folder "../../", "/repo"
  config.vm.provision :chef_solo do |chef|
# the line below is used if you need a proxy
#    config.proxy.http  = "http://web-proxy.corp.hp.com:8080/"
#    config.proxy.https = "http://web-proxy.corp.hp.com:8080/"
# the chef .son you use to pass attributes that you need to rewrite if you use Vagrant for example.
    chef.json = {
    }
    chef.run_list = [
      "recipe[xxxx::default]",
      "recipe[minitest-handler::default]"
    ]
  end
end

vagrant ssh --> to connect to the provisioned system

The vagrant up, destroy, reload, ssh must be ran at the same directory that you have Vagrant file

Eduardo


2013/10/30 Vladimir Skubriev < " target="_blank"> >
30.10.2013 16:47, Eduardo Dias пишет:

Vladimir,

we use Vagrant + Virtual Box + Berkshelf in the developers machines (windows7 & Ubuntu) to test the cookbook before commit it in the repository. My Linux Ubuntu 12.04 I used the configuration below:

Install RVM:
For a Multi-User install you would execute the following:
curl --proxy http://web-proxy.corp.hp.com:8080 -L https://get.rvm.io | sudo bash -s stable

Reload your profile:
source /etc/profile or source ~/.profile

Install and select the appropriated Ruby version:
rvm install 1.9.3
rvm use 1.9.3 --default

Install required gems:
gem install berkshelf
gem install chef
gem install minitest-chef-handler
gem install rest-client

Install Vagrant:
wget http://files.vagrantup.com/packages/7e400d00a3c5a0fdf2809c8b5001a035415a607b/vagrant_1.2.2_x86_64.deb
sudo dpkg -i vagrant_1.2.2_x86_64.deb

Configure Vagrant plugins:
vagrant plugin install vagrant-berkshelf
vagrant plugin install rest-client
vagrant plugin install vagrant-proxyconf (only if you need a proxy)

Install VirtualBox:
sudo apt-get install virtualbox

Create a file named config.json in ~/.berkshelf:
{
"ssl": {
"verify": false
}
}

Good Lucky.

Eduardo


Ok I am do most of that you mail me. What's next ?

$ vagrant up ?




--
Best regards,

CVision Lab System Administrator
Vladmir Skubriev




--

Atenciosamente,

Eduardo



Archive powered by MHonArc 2.6.16.

§