[chef] Re: platform specific config in a cookbook's metadata.rb?


Chronological Thread 
  • From: Morgan Blackthorne < >
  • To: " " < >
  • Subject: [chef] Re: platform specific config in a cookbook's metadata.rb?
  • Date: Mon, 14 Oct 2013 14:33:22 -0700

I believe what you're looking for is addressed here: https://tickets.opscode.com/browse/CHEF-3871

--
~*~ StormeRider ~*~

"Every world needs its heroes [...] They inspire us to be better than we are. And they protect from the darkness that's just around the corner."

(from Smallville Season 6x1: "Zod")

On why I hate the phrase "that's so lame"... http://bit.ly/Ps3uSS


On Mon, Oct 14, 2013 at 2:26 PM, joe.nuspl < " target="_blank"> > wrote:
Taking the erlang cookbook as an example:

depends           "apt", ">= 1.7.0"
depends           "yum", ">= 0.5.0"
depends           "build-essential"

We're a CentOS-only shop so it seems silly to have to load the apt cookbook (and maintain the version forced march) when it will never be used.

I was thinking something like:

case
when platform_family?("debian")
  depends         "apt", ">= 1.7.0"
  suggests        "build-essential"
when platform_family?("rhel")
  depends         "yum", ">= 0.5.0"
  suggests        "build-essential"
else
  depends         "build-essential"
end

This does not work.  I suppose these could be "suggest" and let the include_recipe fail.  Is there an "official" pattern for this?

Thanks.

        Joe




Archive powered by MHonArc 2.6.16.

§