[chef] Re: Re: Re: Re: Redhat admins, if a cookbook enables EPEL, is that a surprise?


Chronological Thread 
  • From: "Eric G. Wolfe" < >
  • To:
  • Cc: "Eric G. Wolfe" < >, Joshua Timberman < >
  • Subject: [chef] Re: Re: Re: Re: Redhat admins, if a cookbook enables EPEL, is that a surprise?
  • Date: Tue, 20 Nov 2012 21:36:34 -0500

To clarify, that logic could be handled in either the LWRP itself, or the template. The calling recipe using the LWRP should be kept kludge free, if possible. In other words, it should be clear to the end-user (of the LWRP) that the LWRP will make the right decision to set a mirrorlist or baseurl.

Eric G. Wolfe
Senior Linux Administrator,
IT Infrastructure Systems
--------------------------------------
Marshall University Computing Services
Drinko Library 428-K
One John Marshall Dr.
Huntington, WV 25755
Phone: 304.942.3970
Email: 


You will be recognized and honored as a community leader.

On 11/20/2012 09:29 PM, Eric G. Wolfe wrote:
Joshua, because of COOK-1653, I don't think he could do that unless he actually provided a mirrorlist.

When that LWRP first got released, mirrorlist was a boolean. So if mirrorlist was true, it sets the url as the mirrorlist in the template. If mirrorlist was false, it places the url as baseurl, in the template. Because EPEL uses a mirrorlist, if you passed in a baseurl of a local mirror, it would probably not work with the mirrorlist keyword in the rendered template. We don't really have the logic to handle that in the recipe, it passes in mirrorlist blindly without any sanity checking here.

The recipe as it stands.

yum_repository "epel" do
  description "Extra Packages for Enterprise Linux"
  key node['yum']['epel']['key']
  mirrorlist node['yum']['epel']['url']
  action platform?('amazon') ? [:add, :update] : :add
end

If we were to revert to using a pure boolean (not a boolean -OR- a string for mirrorlist), one could set the mirrorlist to false, set the url to the baseurl of the local mirror, and let the template handle the logic. On the other hand, you could set mirrorlist to true, and the url attribute to the EPEL mirrorlist if you wanted to use the default behavior. Again letting the template handle that url/mirrorlist switching logic.

Eric G. Wolfe
Senior Linux Administrator,
IT Infrastructure Systems
--------------------------------------
Marshall University Computing Services
Drinko Library 428-K
One John Marshall Dr.
Huntington, WV 25755
Phone: 304.942.3970
Email: 


You will be recognized and honored as a community leader.

On 11/20/2012 08:56 PM, Joshua Timberman wrote:
Ohai,


On 11/20/12 6:30 PM, "David Petzel" 
< >
 wrote:

I'd much rather see a boolean attribute of "use_public_epel" or something
with that intent. This way I have the option to use the external repo,
however I still have the flexibility to use an internal repo if your
nodes don't have access to the public net, or if you just don't want to
traverse the wan link on multiple nodes, when you've got the same package
available internally.
The current version of the cookbook, 2.0.0, has an attribute for setting
the EPEL URL:

     node['yum']['epel']['url']

By default its the appropriate mirror list URL from the Fedora project
site based on platform and platform version.

If you have an internal yum repository that you use for EPEL, or to
"mimic" EPEL, you can use that URL instead.






Archive powered by MHonArc 2.6.16.

§