Include ec2.ini doc changes from https://github.com/ansible/ansible/pull/11236 and https://github.com/ansible/ansible/pull/11409.
This commit is contained in:
Chris Church
2015-06-30 12:41:45 -04:00
parent 1f423ea829
commit 0c6459cd07
2 changed files with 13 additions and 7 deletions

View File

@@ -520,7 +520,10 @@ class Ec2Inventory(object):
# Inventory: Group by tag keys
if self.group_by_tag_keys:
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)
if self.nested_groups:
self.push_group(self.inventory, 'tags', self.to_safe("tag_" + k))