fabric/fabric — pull request #594 by mikery (2012-03-20 11:15:41+00:00)
Title: Add ec2_tags decorator

Amazon's EC2 allows you to tag instances with user-defined tags. Many people use this to define roles for their instances, for example my instances are tagged "role=webserver", "role=dbserver" etc.

This commit adds an ec2_tags decorator, which can be used to execute the task on all hosts that match the given tags, for example:

@ec2_tags({'role': 'webserver'})
def get_hostname()
run('hostname')

I'm not sure if there is any interest in having something like this in Fabric's core - if there is, I would be happy to make any suggested changes/improvements. I have also included very basic documentation.