Reputation: 1204
I am using EC2 machines and I want that for each node that associated with chef server have information of its AWS tags (Eg. name etc).
One way is to set this information in ohai and use this in chef recipe. How to set this information in ohai data ?
or
How to set some attributes (these represent AWS tags) different for each node,so we can use these attributes in chef recipe.
Is there any way to fetch tags of EC2 node in chef recipe itself without depend on above two ?
Upvotes: 0
Views: 370
Reputation: 54251
Unfortunately EC2 tags are not included in the EC2 instance metadata for some reason. This means that tags are not easily available for Ohai to query. You could use EC2 IAM roles and a custom Ohai plugin to implement this, but either the IAM policy would be amazingly complex or you would need to weight the security risks of nodes being able to see each others' tags.
tl;dr EC2 tags are not available in this way.
Upvotes: 0