-
Notifications
You must be signed in to change notification settings - Fork 218
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
Inventory module site and prefix data extended #646
Inventory module site and prefix data extended #646
Conversation
…plete site data, and (optionally) prefixes
…plete site data, and (optionally) prefixes
…/github.com/Eric-Sim/ansible_modules into eric.sim-inventory_site_and_prefix_extended Commit after Rebase with Devel
Please link to issue #640 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some thoughts
approved a run through CI |
Looks like 2 of the tasks are issues with the CI pipeline itself, but the other 2 are black complaining. Please let me know if I need to allow black to reformat. |
I think we need to tweak our |
Not quite sure why this happens. @Eric-Sim Do you run |
I had run black locally to format the code. And it did apply the same formatting that the project CI/CD pipeline is trying to apply. The problem was what @sc68cal had pointed out, it ends up changing things that are outside the scope of what I revised; so I reverted those. I will rebase from devel tonight. |
My branch is up to date. No new commits in Devel that I can rebase into my branch. I have re-run black locally and committed its formatting changes. |
OK, something must be going on with your local |
Sorry for the slow update. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, probably this needs to be a squash & merge operation
What about the functionality for For users who have both physical and virtual infrastructure a feature parity between the 2 apps would really be needed - or everything must be done for the lowest common denominator (i.e. if some feature is only for |
Hey @bluikko, I can look back through when I get a chance. |
I've got the site object getting populated correctly into hostvars and see a single prefix in site, however, only the 1st prefix for each site seems to be getting populated. All of our sites have prefix_count > 1 but I don't see the rest of the prefixes. e.g.
|
@k-y Could you open an issue with enough data to reproduce? |
I've spoken with them and I'll open the ticket.
...and fix it. :)
…On Sun, Feb 6, 2022, 13:31 Martin Rødvand ***@***.***> wrote:
@k-y <https://github.com/k-y> Could you open an issue with enough data to
reproduce?
—
Reply to this email directly, view it on GitHub
<#646 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWKJUMY2VD2L5P5QG4SBRJLUZ3SDHANCNFSM5HT6VKTA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This PR satisfies (Issue #640) without causing any changes to default functionality.
Both the extension of Site Data and Prefix Data are enabled by additional parameters passed to the module.
site_data: (boolean)
prefixes: (boolean)
These changes follow the same methodology as the interfaces option.
No changes in the default behavior of the module in order to guarantee legacy applications will continue working as intended.
The site_data parameter will cause the entire data structure returned by the /api/dcim/sites API call to be captured and inserted into hostvars appropriately for each device in inventory, instead of just the slug that is collected currently.
The prefixes option extends this section of the hostvars further by nesting the datastructure of the prefix assigned to the site as well. This is done by a calling an additional endpoint /api/ipam/prefixes.
Current optimizations are maintained with the "fetch_all" option.
Only ACTIVE prefixes, that are assigned to a site are pulled; and only for the sites that have at least one queried device assigned to them.