- From: John Alberts <
>
- To:
- Subject: [chef] Re: Re: Re: toggling yum repos to enabled, disabled
- Date: Fri, 6 Apr 2012 09:07:00 -0500
Well, I see now why the author of the yum cookbook decided to add that
unless statement. If it's not there, the file is update every single
time, which of course then notifies the execute statement for running
yum makecache. This obviously ends up wasting a lot of time for every
chef run. I dont really understand why chef thinks the template has
changed therefore it thinks the file should be updated.
Is anyone else experiencing this if you have removed the 'unless
::File.exists?("/etc/yum.repos.d/#{new_resource.repo_name}.repo")'
line from yum/providers/repository.rb?
John
On Mon, Apr 2, 2012 at 9:23 PM, Eric G. Wolfe
<
>
wrote:
>
>
On 04/02/2012 05:54 PM, John Alberts wrote:
>
>
>
> I ran into this problem yesterday. In the yum cookbook file
>
> yum/providers/respository.rb, comment out the following line:
>
> unless ::File.exists?("/etc/yum.repos.d/#{new_resource.repo_name}.repo")
>
>
>
> I don't understand the point of this line anyway.
>
>
This check doesn't seem to make sense. Essentially, "unless" means "not if"
>
when testing if the file exists. The template resource within that block
>
should be idempotent without that File.exists check.
>
>
It could lead to undesired behavior if you want to update an already managed
>
repo. I cannot say I have noticed this effect in all the time I've used
>
this resource, however. It could be a bug. Unless I am reading that wrong,
>
and the line is intended for some other purpose.
--
John Alberts
- [chef] toggling yum repos to enabled, disabled, kallen, 04/02/2012
- [chef] Re: toggling yum repos to enabled, disabled, John Alberts, 04/02/2012
- [chef] Re: Re: toggling yum repos to enabled, disabled, kallen, 04/02/2012
- [chef] Re: Re: toggling yum repos to enabled, disabled, Eric G. Wolfe, 04/02/2012
- [chef] Re: Re: toggling yum repos to enabled, disabled, Eric G. Wolfe, 04/02/2012
- [chef] Re: Re: Re: toggling yum repos to enabled, disabled, John Alberts, 04/06/2012
Archive powered by MHonArc 2.6.16.