Skip to content

Commit

Permalink
netbox: inventory: fix implementation of groups option (ansible#57689)
Browse files Browse the repository at this point in the history
(cherry picked from commit 71a704c)
  • Loading branch information
steffann authored and resmo committed Jun 14, 2019
1 parent daef4d9 commit 7f7b250
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/57688-netbox-groups.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- netbox - Fix missing implementation of `groups` option (https://github.com/ansible/ansible/issues/57688)
3 changes: 2 additions & 1 deletion lib/ansible/plugins/inventory/netbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,9 @@ def main(self):

# 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)
Expand Down

0 comments on commit 7f7b250

Please sign in to comment.