mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 02:50:02 -03:30
added ec2 tags_none grouping for hosts without tags
This commit is contained in:
parent
4dff25884f
commit
a6fdd9534e
@ -922,6 +922,7 @@ class InventorySourceOptions(BaseModel):
|
||||
('security_group', 'Security Group'),
|
||||
('tag_keys', 'Tags'),
|
||||
('vpc_id', 'VPC ID'),
|
||||
('tag_none', 'Tag None'),
|
||||
]
|
||||
|
||||
@classmethod
|
||||
|
||||
@ -264,6 +264,7 @@ class Ec2Inventory(object):
|
||||
'group_by_vpc_id',
|
||||
'group_by_security_group',
|
||||
'group_by_tag_keys',
|
||||
'group_by_tag_none',
|
||||
'group_by_route53_names',
|
||||
'group_by_rds_engine',
|
||||
'group_by_rds_parameter_group',
|
||||
@ -508,6 +509,10 @@ class Ec2Inventory(object):
|
||||
if self.nested_groups:
|
||||
self.push_group(self.inventory, 'route53', name)
|
||||
|
||||
# Global Tag: instances without tags
|
||||
if self.group_by_tag_none and len(instance.tags) == 0:
|
||||
self.push(self.inventory, 'tag_none', dest)
|
||||
|
||||
# Global Tag: tag all EC2 instances
|
||||
self.push(self.inventory, 'ec2', dest)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user