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)