Reputation: 107
I am very new to chef. I have added few cookbooks and it seems all is working. I am able to run chef on my ec2 node. Now I am trying to set /etc/hosts file, for that I need IPs. I found that ohai cloud plugin (https://github.com/chef/ohai/blob/master/lib/ohai/plugins/cloud.rb) can do this. But I don't know how to do that.
Any suggestions?
Upvotes: 0
Views: 1011
Reputation: 54251
On EC2 you need to set a hint file in /etc/chef/ohai/hints/ec2.json
. The file can be empty (and should be), but it needs to exist to tell Ohai to run the EC2 logic. This is because there is no good way to know if you are on an EC2 VM only looking at the VM itself.
Upvotes: 2