1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

add tag grouping

Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
Thomas Sjögren 2016-09-28 00:16:38 +02:00 committed by Brian Coca
parent d24bf49d3f
commit b35d4d7a19

View file

@ -401,6 +401,11 @@ or environment variables (DO_API_TOKEN)\n''')
self.inventory[image] = { 'hosts': [ ], 'vars': {} } self.inventory[image] = { 'hosts': [ ], 'vars': {} }
self.inventory[image]['hosts'].append(dest) self.inventory[image]['hosts'].append(dest)
if droplet['tags']:
for tag in droplet['tags']:
if tag not in self.inventory:
self.inventory[tag] = { 'hosts': [ ], 'vars': {} }
self.inventory[tag]['hosts'].append(dest)
def load_droplet_variables_for_host(self): def load_droplet_variables_for_host(self):