[chef] Re: Omnibus 4.0 and Ohai question


Chronological Thread 
  • From: Yvonne Lam < >
  • To:
  • Subject: [chef] Re: Omnibus 4.0 and Ohai question
  • Date: Wed, 8 Apr 2015 13:00:48 -0700

Eric,

You can use "ohai['platform']" (with lowercase "o") in your software definition:


Yvonne

On Wed, Apr 8, 2015 at 12:24 PM, Eric G. Wolfe < " target="_blank"> > wrote:
I am coming back to Omnibus and updating some software definitions
having not used Omnibus in 6 months.

I used to be able to reference Ohai['platform'] but that returns a no
method error on Omnibus 4.0

Error:

    config/software/package.rb:20:in `evaluate': undefined method `[]'
for Ohai:Module (NoMethodError)

Line causing error:

    version_name_string =
"#{Ohai['platform']}-#{Ohai['platform_version']}-#{Ohai['kernel']['machine']}-#{version_string}"

So what do I need to do to reference Ohai data in an Omnibus 4.0
software definition?

I do know in some cases there are chef-sugar helpers like `windows?`
that can be used to switch on platform conditions.  I couldn't find
relevant documentation, and if someone could point me at an example it
would be kindly appreciated.

--
Eric G. Wolfe
email: ">
cell: 304.942.3970
twitter: @atomic_penguin

Cycle Computing
Better Answers. Faster.

http://www.cyclecomputing.com
twitter: @cyclecomputing




Archive powered by MHonArc 2.6.16.

§