[chef] Re: Re: toggling yum repos to enabled, disabled


Chronological Thread 
  • From: "Eric G. Wolfe" < >
  • To:
  • Subject: [chef] Re: Re: toggling yum repos to enabled, disabled
  • Date: Mon, 02 Apr 2012 22:18:28 -0400


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 should be idempotent without that File.exists check.

It could lead to undesired behavior if you want to update an already managed repo file. I cannot say I have ever noticed this effect in all the time I've used this resource, however. It could possibly be a bug. Maybe I am reading this wrong, and it has another purpose.

Regards,
John


On Mon, Apr 2, 2012 at 4:05 
PM,< >
  wrote:
hi.

i'm trying to wield the yumrepo cookbook to control the yum repos i dist
to my systems. by default, the yum_repository resource from the yum
cookbook marks the repo as enabled. so it seems i should be able to
toggle that and make the repo disabled by default. but my attempts are
failing.

this is the yum_repository block from the yumrepo::epel recipe:

yum_repository "epel" do
  description "Extra Packages for Enterprise Linux"
  key node['repo']['epel']['key']
  url node['repo']['epel']['url']
  mirrorlist true
  action :add
end

above the action line i've tried adding 'enabled "0"' and 'enabled 0',
but the /etc/yum.repos.d/epel.repo shows up as "enabled=1".

how do i toggle repos as enabled or disabled?

thanks,
kallen






Archive powered by MHonArc 2.6.16.

§