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"):
http://github.com/opscode/cookbooks/tree/master/apt/
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: schisamo@opscode.com
Twitter, IRC, Github: schisamo
On Wed, Oct 27, 2010 at 11:49 PM, Lee Huffman lee.huffman@blueboxgrp.comwrote:
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: gist:d0d1316453b3a4cc7d91 · GitHub
However, I have no problem installing the package manually.
System output: gist:2f4ef87eba8bb6d7c5de · GitHub
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?