mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
for tags with empty value, do not append separator
This commit is contained in:
parent
4cac10e016
commit
a0e8b9ef98
1 changed files with 4 additions and 1 deletions
|
@ -520,7 +520,10 @@ class Ec2Inventory(object):
|
||||||
# Inventory: Group by tag keys
|
# Inventory: Group by tag keys
|
||||||
if self.group_by_tag_keys:
|
if self.group_by_tag_keys:
|
||||||
for k, v in instance.tags.items():
|
for k, v in instance.tags.items():
|
||||||
key = self.to_safe("tag_" + k + "=" + v)
|
if v:
|
||||||
|
key = self.to_safe("tag_" + k + "=" + v)
|
||||||
|
else:
|
||||||
|
key = self.to_safe("tag_" + k)
|
||||||
self.push(self.inventory, key, dest)
|
self.push(self.inventory, key, dest)
|
||||||
if self.nested_groups:
|
if self.nested_groups:
|
||||||
self.push_group(self.inventory, 'tags', self.to_safe("tag_" + k))
|
self.push_group(self.inventory, 'tags', self.to_safe("tag_" + k))
|
||||||
|
|
Loading…
Reference in a new issue