- From: Hedge Hog <
- Subject: [chef] How to use Ohai in a EC2 userdata script?
- Date: Wed, 28 Sep 2011 13:15:15 +1000
I am using Ohai 0.6.4.
I don't seem to be able to get Ohai to return EC2 data consistently.
When I run this ruby script by passing it in via the AMI userdata:
o = Ohai::System.new
I get the results:
So, the metadata is retrieved, but the second two EC2 methods don't
seem to work.
More puzzling is that if I SSH to the instance, and run this same
script, the o[:ec2] contains the data I'd expect.
So how does one use Ohai, correctly, in an EC2 user data script?
Appreciate any insights.
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
Archilochus, Greek poet (c. 680 BC – c. 645 BC)
- [chef] How to use Ohai in a EC2 userdata script?, Hedge Hog, 09/27/2011
Archive powered by MHonArc 2.6.16.