$ ansible --version
ansible 1.8 (develop 0179c13e04) last updated 2014/10/24 11:53:25 (GMT -700)
Right now I'm using "-i inventories/ec2.py -l 'tag_Environment_<environment>" to apply playbooks to servers in an environment, by IP address.
Now I have playbooks to stop and start all instances in an environment, but haven't found a way to use ec2.py to apply these playbooks to all servers in the environment because stop and start needs a list of instance IDs rather than IP addresses. Is there a way? I'm thinking not, because ec2.py I don't see instance_id in the list of variables returned when run against a specific host.
If not, my intent is to write a script to use the cli to generate/regenerate a list of instance IDs for the instance_ids variable.
Thanks for any help,
Paul
def __init__(self):
''' Main execution path '''
# Inventory grouped by instance IDs, tags, security groups, regions,
# and availability zones
self.inventory = self._empty_inventory()
# Index of hostname (address) to instance ID
self.index = {}