Skip to content

Instantly share code, notes, and snippets.

@pburkholder
Created August 29, 2014 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pburkholder/b83eda3696aa35cb85a0 to your computer and use it in GitHub Desktop.
Save pburkholder/b83eda3696aa35cb85a0 to your computer and use it in GitHub Desktop.
Here’s a little one liner that you can paste into a terminal that has the chef gem installed:
#/usr/bin/env ruby -r chef
o = Ohai::System.new; o.load_plugins; @data = Mash.new; o.run_plugins.each { |plugin| @data = Chef::Mixin::DeepMerge.deep_merge(@data, plugin.data) }; File.open('/tmp/ohai.json', 'w') { |f| f.write(JSON.pretty_generate(@data)) }”
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment