- From: Matt Ray <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Adding Yum Repos in a chef run
- Date: Fri, 21 Jan 2011 11:10:00 -0600
It's probably worthwhile to put together a yum cookbook, similar to
the apt one that provides an LWRP for adding external repositories.
It's on my list of things to get to eventually, but if it's a more
pressing concern please jump on that.
Thanks,
Matt Ray
Technical Evangelist | Opscode, Inc
E:
T: (512) 731-2218
Twitter, Github: mattray
On Fri, Jan 21, 2011 at 9:35 AM, Sean OMeara
<
>
wrote:
>
you have to execute a "yum clean all" or "yum clean headers" after
>
adding a repo, otherwise it will use cached data.
>
>
-s
>
>
On Fri, Jan 21, 2011 at 7:32 AM, Haselwanter Edmund
>
<
>
>
wrote:
>
>
>
> On 21.01.2011, at 13:21, Avishai Ish-Shalom wrote:
>
>
>
>> Repositories are best installed early, so force the remote_file resource
>
>
>
> Ah. Forgot about that pattern (like with installing and using gems)
>
>
>
>> to run at compile time, E.G.:
>
>>
>
>> r = remote_file "/etc/yum.repos.d/RubyWorks.repo" do
>
>> source "http://rubyworks.rubyforge.org/RubyWorks.repo"
>
>> mode "0644"
>
>> end
>
>>
>
>> r.run_action(:create_if_missing)
>
>
>
> many thanks, will try that
>
>
>
>>
>
>> Regards,
>
>> Avishai
>
>>
>
>>
>
>> On 01/21/2011 01:54 PM, Haselwanter Edmund wrote:
>
>>
>
>>> Hi,
>
>>>
>
>>> just run in a problem with adding a repo to yum and install a package in
>
>>> the same chef run
>
>>>
>
>>> simplified version:
>
>>>
>
>>> if node[:platform] =~ /centos|redhat/i
>
>>> #not in default repos
>
>>> remote_file "/etc/yum.repos.d/RubyWorks.repo" do
>
>>> source "http://rubyworks.rubyforge.org/RubyWorks.repo"
>
>>> mode "0644"
>
>>> action :create_if_missing
>
>>> end
>
>>>
>
>>> package "runit" do
>
>>> action :install
>
>>> end
>
>>>
>
>>> this fails in the first run
>
>>>
>
>>> [Thu, 20 Jan 2011 18:48:54 -0500] INFO:
>
>>> remote_file[/etc/yum.repos.d/RubyWorks.repo]: Creating
>
>>> /etc/yum.repos.d/RubyWorks.repo
>
>>> [Thu, 20 Jan 2011 18:48:54 -0500] INFO: Setting mode to 644 for
>
>>> remote_file[/etc/yum.repos.d/RubyWorks.repo]
>
>>> [Thu, 20 Jan 2011 18:48:54 -0500] ERROR: package[runit]
>
>>> (/var/chef-solo/cookbooks/runit/recipes/default.rb:64:in `from_file')
>
>>> had an error:
>
>>> No version specified, and no candidate version available for runit
>
>>> /usr/lib64/ruby/gems/1.8/gems/chef-0.9.8/bin/../lib/chef/provider/package.rb:50:in
>
>>> `action_install'
>
>>>
>
>>> but succeeds in the following runs
>
>>>
>
>>> cu edi
>
>>>
>
>>> --
>
>>> DI Edmund Haselwanter,
>
>>>
,
>
>>> http://edmund.haselwanter.com/
>
>>> http://www.iteh.at | http://facebook.com/iTeh.solutions |
>
>>> http://at.linkedin.com/in/haselwanteredmund
>
>>>
>
>>>
>
>>>
>
>>>
>
>>>
>
>
>
> --
>
> DI Edmund Haselwanter,
>
>
,
>
> http://edmund.haselwanter.com/
>
> http://www.iteh.at | http://facebook.com/iTeh.solutions |
>
> http://at.linkedin.com/in/haselwanteredmund
>
>
>
>
>
>
>
>
>
>
>
>
>
Archive powered by MHonArc 2.6.16.