[chef] Re: Re: Omnibus 4.0 and Ohai question


Chronological Thread 
  • From: "Eric G. Wolfe" < >
  • To:
  • Subject: [chef] Re: Re: Omnibus 4.0 and Ohai question
  • Date: Wed, 08 Apr 2015 16:11:32 -0400

Thank you, Yvonne!

Eric G. Wolfe
email: 

cell: 304.942.3970
twitter: @atomic_penguin

Cycle Computing
Better Answers. Faster.

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

On 04/08/2015 04:00 PM, Yvonne Lam wrote:
> Eric,
> 
> You can use "ohai['platform']" (with lowercase "o") in your software
> definition:
> 
> https://github.com/chef/omnibus/blob/master/lib/omnibus/project.rb#L681-692
> https://github.com/chef/omnibus-software/blob/master/config/software/ruby.rb#L77
> 
> Yvonne
> 
> On Wed, Apr 8, 2015 at 12:24 PM, Eric G. Wolfe 
> < >
>  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.

§