saltstack/salt-contrib — pull request #45 by emilisto (2013-07-22 20:16:28+00:00)
Title: [grains] Grain for getting all tags assigned to the current EC2 instance

I made this grain for fetching all EC2 tags in a general way.

I think it'd be nice if we could merge all three EC2 grains into one `ec2` grain. Getting meta data and tags are different in the sense that meta data requires no credentials, while tags do.

Therefore I suggest that `ec2` would do this:

1. Get all meta data and expose as grains
2. If access credentials are available, provide the `ec2_tags` grain as well

@dginther: I'd love your input on this: `ec2_tag_roles` treats the tags `Roles` and `Name` special, while my grain treats them like any other tag. Either one could implement this in `ec2_tags`, or one could do the splitting on comma in the Jinja template.