ansible_modules icon indicating copy to clipboard operation
ansible_modules copied to clipboard

[Feature]: nb_inventory: use jinja templating for parent_group

Open beudbeud opened this issue 3 years ago • 1 comments

NetBox version

v3.6.0

Feature type

Change to existing Plugin

Proposed functionality

Allow jinja templating in parent group name for can create dynamically a group hierarchy

Use case

  - key: cluster[0:3] + cluster[4:7] if name | regex_search('^par')
    parent_group: par
    separator: ''

It can be something like that

  - key: cluster[0:3] + cluster[4:7] if name | regex_search('^par')
    parent_group: cluster[0:3]
    separator: ''

External dependencies

No response

beudbeud avatar Nov 08 '22 13:11 beudbeud

Hey, is there a way to sponsor you into looking into this :) having a way of creating deeper nested trees of groups would be amazing.

like

  • key: x
  • key: xx parent_group: x
  • key xxx parent_group: xx
  • key: yyy parent_group: xx

could generate:

@all: | --@x1: | |--@xx1: | | |--@xxx1: | | | |--hostxxx1 | | | |--hostxxx2 | | |--@yyy1: | | | |--hostyyy1 | | | |--hostyyy2 | |--@xx2: | | |--@xxx2: | | | |--hostxxx3 | | | |--hostxxx4 | | |--@yyy2: | | | |--hostyyy3 | | | |--hostyyy4 | --@x2: | |--@xx3: | | |--@xxx3: | | | |--hostxxx5 | | | |--hostxxx6 | | |--@yyy3: | | | |--hostyyy5 | | | |--hostyyy6

JohanLeirnes avatar Nov 08 '23 16:11 JohanLeirnes