I think you correctly caught my point. This seems very workable, if the 'yum-epel" can be reasonably included inside a recipe I’m writing. Getting it into an upstream recipe that hasn’t predetermined what yum repositories I’m personally selecting… may take more work.
But it looks like a solid approach, I’ll try it.
–
Nico Kadel-Garcia
Senior Systems Consultant
Email: nkadelgarcia-consultant@scholastic.com
Cell Phone: +1.339.368.2428
From: Marco Betti m.betti@gmail.com
Sent: Thursday, March 13, 2014 11:58 AM
To: chef@lists.opscode.com
Subject: [chef] Re: Getting local yum repositories enabled before other cookbooks demand them in bootstrap
Hi Nico,
I don’t know if I correctly caught up your point, but usually, when I want to be sure a yum repo will be available during my chef run convergence I force its configuration at compile time [2], using resources method [1]:
This is an example with epel repo:
include_recipe 'yum-epel’
y = resources(“yum_repository[epel]”)
y.action(:nothing)
y.run_action(:create)
[1] http://docs.opscode.com/dsl_recipe_method_resources.html
[2] https://wiki.opscode.com/display/chef/Evaluate+and+Run+Resources+at+Compile+Time;jsessionid=BBE750D0DC249823649B3F4F70F24C82
Cheers,
Marco
On Thu, Mar 13, 2014 at 12:43 PM, Kadel-Garcia, Nico <NKadelGarcia-consultant@scholastic.commailto:NKadelGarcia-consultant@scholastic.com> wrote:
Good morning!
I’m testing some CentOS based systems that need Percona clustering. If I bootstrap the systems and have the ‘recipe[yum::epel],recipe[yumrepo::percona]’ recipes in the bootstrap run list, all is good. If I then configure the mysql settings to require the Percona versions of MySQL components, such as setting the ":mysql => { :server => { packages => “Percona-XtraDB-Cluster-Server” } }’ and other relevant settings, those packages are not visible at the time I do the initial bootstrap, so the bootstrap fails. They’re only visible to chef after some earlier chef run has already enabled the particular yum repositories.
I’m not an expert, and this confuses me. Is there any graceful way to get the yum repositories enabled, and their contents properly detected, for later processing by mysql recipes?
–
Nico Kadel-Garcia
Senior Systems Consultant
Email: nkadelgarcia-consultant@scholastic.commailto:nkadelgarcia-consultant@scholastic.com
Cell Phone: +1.339.368.2428tel:%2B1.339.368.2428
–
Ing. Marco Betti
RHCE RHEL4 id 804006512121056