[chef] Re: How to configure apt to not hit the repo every time?


Chronological Thread 
  • From: Jens Skott < >
  • To: " " < >
  • Subject: [chef] Re: How to configure apt to not hit the repo every time?
  • Date: Sat, 18 May 2013 15:25:53 +0200

Or run vagrant with --no-provisioner and if you need chef to do something just run the chef scripts. Or is it something else you are looking for?

On Saturday, May 18, 2013, Mark Nichols wrote:

Hi, I'm developing a cookbook using Berkshelf and Vagrant latest.

There is a place in the recipe that runs apt-get update frequently and other dependent cookbooks too like the following:

[2013-05-18T11:21:48+00:00] INFO: Processing execute[apt-get update] action run (mysql::ruby line 23)

Its fine on the production node, but in the vagrant provision way, every time I run, it will hit the apt-get update which is a bit slow coz it hits via the internet.

How can I configure Vagrant to just hit only once in a single vagrant provision command?
Or do I have to do change something else?

You might look into the resolver cookbook to set up your VM DNS. I found that by default the VM passes everything to VirtualBox and, only when that timed out, to the host machine's DNS gateway. My build times dropped 25% when I put resolver in as the first recipe in the run list. 

Hope this helps,
Mark



@millisami
~Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.com


--

Jens Skott 
Tel: +46-8-5142 4396
Schibsted Centralen IT





Archive powered by MHonArc 2.6.16.

§