netbox: inventory: fix implementation of groups option (#57689)

This commit is contained in:
Sander Steffann 2019-06-14 06:29:47 +02:00 committed by René Moser
parent 7d85cbcc6c
commit 71a704cc14
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- netbox - Fix missing implementation of `groups` option (https://github.com/ansible/ansible/issues/57688)

View file

@ -434,8 +434,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable):
# Composed variables
self._set_composite_vars(self.get_option('compose'), host, hostname, strict=strict)
# Complex groups based on jinja2 conditionals, hosts that meet the conditional are added to group
self._set_composite_vars(self.get_option('compose'), host, hostname, strict=strict)
self._add_host_to_composed_groups(self.get_option('groups'), host, hostname, strict=strict)
# Create groups based on variable values and add the corresponding hosts to it
self._add_host_to_keyed_groups(self.get_option('keyed_groups'), host, hostname, strict=strict)