GCE tag prefix for creating ansible group.

This commit is contained in:
Mathieu Lecarme 2015-07-17 22:28:30 +02:00
parent 271a7f3281
commit 1873e8ed08

View file

@ -257,6 +257,9 @@ class GceInventory(object):
tags = node.extra['tags'] tags = node.extra['tags']
for t in tags: for t in tags:
if t.startswith('group-'):
tag = t[6:]
else:
tag = 'tag_%s' % t tag = 'tag_%s' % t
if groups.has_key(tag): groups[tag].append(name) if groups.has_key(tag): groups[tag].append(name)
else: groups[tag] = [name] else: groups[tag] = [name]