Created
October 28, 2011 15:05
-
-
Save tjl2/1322487 to your computer and use it in GitHub Desktop.
What's in node?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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