[chef] Re: value_for_platform wildcard?


Chronological Thread 
  • From: "Julian C. Dunn" < >
  • To: " " < >
  • Subject: [chef] Re: value_for_platform wildcard?
  • Date: Wed, 5 Nov 2014 23:59:23 -0500

That feature will be available in Chef Client 12. You can try the RC
now to see if it works for you.

docs.getchef.com/release/12-0/release_notes.html

===

value_for_platform

The value_for_platform helper may use version constraints, such as >=
and ~> to help resolve situations where version numbers look like
7.0.<buildnumber>. For example:

value_for_platform(
  "redhat" => {
    "~> 7.0" => "version 7.x.y"
    ">= 8.0" => "version 8.0.0 and greater"
  }
}

- Julian

On Wed, Nov 5, 2014 at 11:39 PM, Kevin Keane Subscription
< >
 wrote:
> Is there a wildcard for the value_for_platform function? Specifically, I'm
> interested in the version field; rather than specifying the specific CentOS
> version, I would like to specify "all Centos 7 versions". Unfortunately,
> Ohai reports a *very* specific version number (in my case, 7.0.1406) which
> means that my code would break as soon as a new build comes out.
>
>
> What I am trying to accomplish is something like this:
>
>
> my values = value_for_platform(
>   %w{ centos redhat } => {
>      "7.x"     =>[ values for Centos 7 ]
>      "default" => [ values for Centos 5 and 6 ]
>    },
>    "default" => { "default" => %w{} }
> )
>
> Thanks!
>
>
> Kevin Keane
>
> The NetTech
>
> http://www.4nettech.com
>
> Our values: Privacy, Liberty, Justice
>
> See https://www.4nettech.com/corp/the-nettech-values.html
>
>



-- 
[ Julian C. Dunn 
< >
          * Sorry, I'm    ]
[ WWW: http://www.aquezada.com/staff/julian    * only Web 1.0  ;]
gopher://sdf.org/1/users/keymaker/           * compliant!    ;]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9       ]



Archive powered by MHonArc 2.6.16.

§