[chef] Re: Passing responses back to Chef?


Chronological Thread 
  • From: Daniel DeLeo < >
  • To: Brad Knowles < >
  • Cc:
  • Subject: [chef] Re: Passing responses back to Chef?
  • Date: Wed, 7 Aug 2013 17:14:03 -0700


On Wednesday, August 7, 2013 at 12:18 PM, Brad Knowles wrote:

On Aug 7, 2013, at 1:55 PM, Daniel DeLeo < "> > wrote:

Can you state more clearly what exactly you're trying to do? I read this whole thread but I can't come up with concrete suggestions because I still don't understand what needs to happen.

See <https://gist.github.com/bknowles/b6d0b8c5d035b5bf95a7>. The attribute req_params['engVers'] represents the major.minor or major.minor.patch version that the user has asked us to install. Anywhere you see "engAvail", that's an indication of the corresponding full and complete version string that I'm trying to pass back into the apt_package resource.


We have a modified version of the Opscode mysql cookbook that we're using to install mysql-server, and we need the ability to install any of a wide variety of versions of MySQL -- possibly hundreds of different versions of mysql-server. No one node would be running any more than a single version, but we could be serving any of thousands and thousands of customers in a multi-tenant environment, any of whom might have a requirement to install a very particular version on their node -- we need to be able to support them all.

For now, we worry about MySQL. Once we get this squared away, then we can worry about other database server technologies, and on other platforms.


Does that help?
Not really. What I'm getting at is, when is the earliest time in the chef run that you could have enough information to figure out what package you've been asked to install? Or put a different way, what are the prerequisites for figuring this out, and are any of them dependent on steps in the chef run? Looking at your gist, you're using `aptitude show` to figure this out, but does that rely on a 3rd party repo getting enabled earlier in the chef run?

In an ideal case, you should be able to feed all the information required to configure your system into chef during the compile phase and let chef sort everything out in the converge phase. If that's true for you here, you can just pull the shell out call out of the ruby_block resource and you'll be good to go. Otherwise, the easiest path would be to create a wrapper LWRP, since LWP actions are evaluated during convergence.
 


-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§