[chef] Re: Re: Re: Re: Recipe management


Chronological Thread 
  • From: Maven User < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Recipe management
  • Date: Fri, 4 May 2012 11:16:39 -0400

Ohhhhh - I like that!

The real rub is supporting windows I guess.  Once the platform is determined it is windows, then all bets are off and things all respond differently.

Essentially I wanted to bury that stuff away and in the default for a given recipe, do the platform test, put the MAIN heavylifting in a library (or include a recipe) but have the testing and idempotent type things squirreled away.

Supporting windows is messy work :-/

Thank you though - I'll keep this technique in mind!!!

On Fri, May 4, 2012 at 11:10 AM, Matt Ray < " target="_blank"> > wrote:
Ideally your recipes shouldn't be that different between platforms, so
a few conditional blocks keying off of platform is generally more
sustainable. Trying to keep parallel paths for different platforms
isn't a very DRY approach. That said, you could use an include_recipe
keying off of the platform to break out just those specific pieces and
come back into the main flow is probably a better approach. Take a
look at how the annoyances cookbook works:

https://github.com/mattray/annoyances-cookbook/blob/master/recipes/default.rb#L20

Thanks,
Matt Ray
Senior Technical Evangelist | Opscode Inc.
"> | (512) 731-2218
Twitter, IRC, GitHub: mattray


On Fri, May 4, 2012 at 10:00 AM, Maven User < "> > wrote:
> Yeah, digging deeper, it seems like people have asked for this same
> feature.  Just stinks trying to support multiple platforms (both *nix AND
> windows) and multiple architectures on each.
>
> Just for a simple jdk installation, that becomes all these if or case blocks
> whereas it'd be much nicer to use libraries+attributes and segregate the
> recipes based on platform/architecture just like the files.
>
> Is that nuts?
>
>
> On Fri, May 4, 2012 at 10:55 AM, Matt Ray < "> > wrote:
>>
>> I believe you've "got your wires crossed" with templates and files.
>>
>> http://wiki.opscode.com/display/chef/File+Distribution#FileDistribution-FileSpecificity
>>
>> Thanks,
>> Matt Ray
>> Senior Technical Evangelist | Opscode Inc.
>> "> | (512) 731-2218
>> Twitter, IRC, GitHub: mattray
>>
>>
>> On Fri, May 4, 2012 at 9:44 AM, Maven User < "> > wrote:
>> > Hi all -
>> >
>> > Super quick - I could have SWORN there was a way to segregate your
>> > recipes
>> > by folder named after the platform you're targeting.
>> >
>> > I can't seem to find that document page and I'm really trying to
>> > minimize
>> > what the recipe has in it for a given platform.
>> >
>> > Anyone know what I'm talking about here or do I have my wires crossed
>> > with
>> > another part of chef?
>
>




Archive powered by MHonArc 2.6.16.

§