Skip to content

Instantly share code, notes, and snippets.

@btm
Last active December 10, 2015 04:38
Show Gist options
  • Save btm/4382499 to your computer and use it in GitHub Desktop.
Save btm/4382499 to your computer and use it in GitHub Desktop.
# Accessing dmi information in the chef-shell
# must use 'sudo shef' or 'sudo chef-shell' for dmidecode
chef > if node[:dmi] && node[:dmi][:system] && node[:dmi][:system][:manufacturer] =~ /VMware/
chef ?> puts "On a VMWare Guest"
chef ?> end
On a VMWare Guest
=> nil
chef > node.automatic[:dmi] = nil
=> nil
chef > if node[:dmi] && node[:dmi][:system] && node[:dmi][:system][:manufacturer] =~ /VMware/
chef ?> puts "On a VMWare Guest"
chef ?> end
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment