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