mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 13:39:27 -02:30
AC-1134 Updated rax/ec2 inventory scripts from ansible. Added ability to filter groups/hosts by regular expression and exclude empty groups, so that Tower can exclude RAX/EC2 instance ID groups and EC2 RDS hosts/groups.
This commit is contained in:
@@ -254,8 +254,7 @@ class Ec2Inventory(object):
|
||||
|
||||
for region in self.regions:
|
||||
self.get_instances_by_region(region)
|
||||
# Don't return RDS instances for Ansible Tower!
|
||||
#self.get_rds_instances_by_region(region)
|
||||
self.get_rds_instances_by_region(region)
|
||||
|
||||
self.write_to_cache(self.inventory, self.cache_path_cache)
|
||||
self.write_to_cache(self.index, self.cache_path_index)
|
||||
@@ -344,9 +343,8 @@ class Ec2Inventory(object):
|
||||
# Add to index
|
||||
self.index[dest] = [region, instance.id]
|
||||
|
||||
# Do not output group based on instance ID for Ansible Tower!
|
||||
# Inventory: Group by instance ID (always a group of 1)
|
||||
#self.inventory[instance.id] = [dest]
|
||||
self.inventory[instance.id] = [dest]
|
||||
|
||||
# Inventory: Group by region
|
||||
self.push(self.inventory, region, dest)
|
||||
|
||||
Reference in New Issue
Block a user