Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add groups to Inventory #3

Open
jvanderaa opened this issue Feb 24, 2021 · 5 comments
Open

Add groups to Inventory #3

jvanderaa opened this issue Feb 24, 2021 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Hacktoberfest good first issues status: help wanted This issue is tentatively accepted pending a volunteer committed to its implementation

Comments

@jvanderaa
Copy link
Contributor

jvanderaa commented Feb 24, 2021

Add ability to add options for groups, in a similar fashion to what the Ansible inventory module will support.

Configuration

options: {
  "group_by": ["tags", "sites"]
}

Underneath considerations

  • Should have a finite list of options to group by that are known to work
  • Unit tests
  • Verify that the group_by option that comes in will work
@jvanderaa jvanderaa changed the title Issue 3 Add groups to Inventory Feb 24, 2021
@jvanderaa jvanderaa added good first issue Good for newcomers help wanted Extra attention is needed enhancement New feature or request labels Apr 23, 2021
@jifox
Copy link

jifox commented Jun 28, 2021

@jvanderaa

Do you think the group names should get the "group_by" as a prefix?

options: {
  "group_by": ["tags", "sites"]
}

Group names for inventory:

tags_tag1, tags_tag2, sites_site1, sites_site2

@jvanderaa
Copy link
Contributor Author

Yeah, that is exactly what I'm thinking of. My goal is to try to get the inventories between Ansible and Nornir to be as close as possible to each other within the projects @jifox. I think that the Ansible inventory has a bunch of terrific features that Nornir could benefit from.

@wvandeun
Copy link
Contributor

@jvanderaa I've done a similar implementation in nornir_netbox
https://github.com/wvandeun/nornir_netbox/blob/76d3d9b2da1190a11f302f28f19b6d1e49528932/nornir_netbox/plugins/inventory/netbox.py#L257-L280

Is this how you envisioned providing group support?

@jvanderaa
Copy link
Contributor Author

The biggest vision was to try to line things up with the Ansible inventory that had a few extra options. But that is not a requirement by any means. I'll welcome what makes sense. What I was thinking of having a key in the inventory options of

{
    "group_by": [
        "site",
        "region",
        # ... and so on
        ]

With the various items.

@jvanderaa
Copy link
Contributor Author

@wvandeun I'm good with the options that make sense to get some groups populating.

@jvanderaa jvanderaa added status: help wanted This issue is tentatively accepted pending a volunteer committed to its implementation and removed help wanted Extra attention is needed labels Jun 27, 2022
@jvanderaa jvanderaa added the hacktoberfest Hacktoberfest good first issues label Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers hacktoberfest Hacktoberfest good first issues status: help wanted This issue is tentatively accepted pending a volunteer committed to its implementation
Projects
None yet
Development

No branches or pull requests

3 participants