[chef-dev] Re: Chef DSL Helpers for Audit-Mode


Chronological Thread 
  • From: Seth Thomas < >
  • To: Ryan Hass < >
  • Cc: " " < >
  • Subject: [chef-dev] Re: Chef DSL Helpers for Audit-Mode
  • Date: Wed, 10 Jun 2015 14:35:10 -0700

Ryan,

Audit mode utilizes ServerSpec, which in turn is a "dialect" of Rspec so using Chef references like `platform` or`platform_family` will not work. You should be able to use `host_inventory['platform']` according to the current ServerSpec docs though in my own ServerSpec recipes I've also been able to use calls like `if %w(freebsd).include?(os[:family])`. I've not spent a lot of time with Audit Mode myself but as it's ServerSpec, one of the two should work for you.

(Apologies if this is a resend, apparently I was subscribed under a different alias so this didn't hit the list)

Cheers,

Seth Thomas
Chef

Seth Thomas
Chef

On Tue, Jun 9, 2015 at 3:54 PM, Ryan Hass < " target="_blank"> > wrote:

I have been playing with Audit mode recently, and found myself in need of performing different assertions for different platforms. I tried using the platform? and platform_family? helpers, as well as node.platform -- but in all cases it seems introspection is not available in audit mode. Is there a way to enable this, and is this something which could be added to future versions of Chef to simplify the use of Audit Mode?


-Ryan H.





Archive powered by MHonArc 2.6.16.

§