[chef] Re: Dealing with back level ohai


Chronological Thread 
  • From: Vladimir Girnet < >
  • To:
  • Subject: [chef] Re: Dealing with back level ohai
  • Date: Wed, 23 Jan 2013 22:56:35 +0200

'platform_family' is the issue here
and it's used already in many cookbooks
I would recommend adding a step to upgrade ohai automatically, and reload ohai in case of upgrade. Make this to be a first step at compile time.


On Wed, Jan 23, 2013 at 9:00 PM, Booker Bense < " target="_blank"> > wrote:

What is the "right" way to deal with this problem? I'm using vagrant and some boxes come with old versions of ohai that cause failures in the chef run. 

The segment below in build-essentials is the current example. 

# Older versions of ohai do not provide a platform_family 
  # Is crashing out with nil method error for the packages.each
  # statement okay or should we silently do nothing or ? 

  packages = case node['platform_family']
    when "debian"
      %w{build-essential binutils-doc}
    when "rhel", "fedora"
      %w{gcc gcc-c++ kernel-devel make}
    when "suse"
      %w{gcc gcc-c++ kernel-default-devel make m4}  # in SLES there is no kernel-devel
    end

If packages is nil after this case statement what is the correct action to take? 

Ideally, I'd like a warning to pop up like 

"Hey, your version of ohai is too old, please upgrade" 

If the chef run fails, fine but at least print a useful error message. 

- Booker C. Bense 





--
Vladimir Girnet
Senior Infrastructure Engineer
Tacit Knowledge, Inc.
http://www.tacitknowledge.com




Archive powered by MHonArc 2.6.16.

§