[chef] Re: Re: Clear package cache?


Chronological Thread 
  • From: Lee Huffman < >
  • To:
  • Subject: [chef] Re: Re: Clear package cache?
  • Date: Thu, 28 Oct 2010 11:31:02 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=blueboxgrp.com; h=message-id:from :to:in-reply-to:content-type:mime-version:subject:date: references; q=dns; s=mail; b=NjufxoqR+A4yKWC25LFfGdVqXwGSsVUhZcq A/SG0IhVzE5lltsMOibfeAjZ0aGmUVyVRZntFseHBVsbHzbzOsy8ZjXI3BdR2DmP vcHsajcJU8btrYrAv0xKhivY+6+N2JT/Vc58axML1g2zEO5Yw/M2gDfOMB/8eIwg rSt9vmyU=

Thanks a lot, Seth. I was able to resolve this with your suggestion and a couple other tweaks.

Appreciate the help!

On Oct 27, 2010, at 9:01 PM, Seth Chisamore wrote:

Lee,
Create an execute resource and notify it from the template that creates the yum repo:

execute "yum clean all" do
  action :nothing
end

template "/etc/yum.repos.d/random_name.repo" do
  notifies :run, resources(:execute => "yum clean all"), :immediately
end

You can also take a look at the APT cookbook since it does something very similar (for "apt-get update"):

They both create an execute resource in the compile phase that is notified and run during the execution phase

Seth

--
Opscode, Inc.
Seth Chisamore, Technical Evangelist
T: (404) 348-0505 E: " target="_blank">
Twitter, IRC, Github: schisamo



On Wed, Oct 27, 2010 at 11:49 PM, Lee Huffman < "> > wrote:
Hello,

I have a recipe that installs a yum repository and then immediately attempts to install packages from that repository. Unfortunately, I'm receiving errors that the package I'm trying to install isn't available.

Chef output: https://gist.github.com/d0d1316453b3a4cc7d91

However, I have no problem installing the package manually.

System output: https://gist.github.com/2f4ef87eba8bb6d7c5de

I attempted to add the following to the recipe (in between the repository's installation and the package's installation):

execute "yum clean all" do
 action :run
end

But continued to receive the same error message. Has anyone experienced this before?





Archive powered by MHonArc 2.6.16.

§