[chef] apt-get update strategy


Chronological Thread 
  • From: Luke Biddell < >
  • To:
  • Subject: [chef] apt-get update strategy
  • Date: Fri, 25 Mar 2011 09:45:48 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=hriisZ5CrTTCheiYdlGfFzx5vicYFtHvQGoJwKRZRXQsuwcxYhlM3NA29eIjtXhGdn 1MH/xGfKFzqp2xRvqQqKKc6AkMcCjBtd+XjwJgHRmUkKqjYCRWpbVxZj3dLoJIR69nQG oJdAfi8Gq2rGDTihhyQqroLTFHvz6Eg12jvo4=

A recent failure in the apache cassandra apt repo got me thinking
about the way I've assembled my cookbooks. I have the apt cookbook
first in my run and do an update. The repo being down gave me the
classic "apt-get update returned 100" error within chef.

The failure meant that none of my recipes ran against the node (and
updated our application war file), despite the fact that the node had
previously been converged and all the required apt packages were
already installed.

My chef run needs to be resilient to those kinds of failures as once a
node is initially converged and all apt packages installed, apt
doesn't need to do an update (I don't do package :upgrade at the
moment).

So what I'd ideally like is to be able to trigger an apt-get update on
the first package which requires installing. If no packages require
installing, no apt-get update is performed. The fact an update has
been performed needs to be recorded as we don't want to do it for
every package that's installed as it will kill performance. Once is
enough per chef run unless we add/remove a sources.list.d entry (which
I already handle using :notifies).


Opinions welcome, am I looking and an LWRP?



Archive powered by MHonArc 2.6.16.

§