Skip to content

Instantly share code, notes, and snippets.

@tjl2
Created October 28, 2011 15:05
Show Gist options
  • Save tjl2/1322487 to your computer and use it in GitHub Desktop.
Save tjl2/1322487 to your computer and use it in GitHub Desktop.
What's in node?
# Run these commands first:
# sudo ohai > ~/ohai.json && sudo cp /etc/chef/dna.json ~/dna.json && sudo chown deploy:deploy ~/dna.json
# Then start an irb session in ~
require 'json'
ohai = JSON.parse(File.read('ohai.json'))
dna = JSON.parse(File.read('dna.json'))
# Examples...
# Find the instance type:
puts ohai['ec2']['instance_type']
# Find the instance role:
puts dna['instance_role']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment