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

Pull complete site data and prefixes (optionally) in Inventory module #640

Closed
Eric-Sim opened this issue Nov 4, 2021 · 0 comments · Fixed by #646
Closed

Pull complete site data and prefixes (optionally) in Inventory module #640

Eric-Sim opened this issue Nov 4, 2021 · 0 comments · Fixed by #646

Comments

@Eric-Sim
Copy link
Contributor

Eric-Sim commented Nov 4, 2021

ISSUE TYPE
  • Feature Idea
SOFTWARE VERSIONS
Ansible:

All

NetBox:

2.11

Collection:

All

SUMMARY

Site data is not pulled by the inventory module, only the slug.
Additionally, Prefix data is not pulled. Prefixes that are assigned to a site in Netbox should be (optionally) inserted into the site data.

STEPS TO REPRODUCE

By default, the inventory module should include site data in the inventory within the "Site" key of devices.
Optionally, by providing "prefixes: True" to the inventory config, Prefixes along with accompanying data should be pulled and inserted into inventory under a "prefixes" key within the "sites" key.

Workflow for pulling the prefixes will follow the precedent established by the "interfaces" and "services" options.
Sites that have prefixes assigned to them will be tracked and passed to get_resource_list_chunked() for optimization when the "fetch_all" option is False.

ansible-inventory -i netbox_inventory.yml --list
EXPECTED RESULTS
ACTUAL RESULTS

NOTES

I've already written the code to accomplish this. I'm opening this issue to be referenced by my forthcoming PR.
I just need to add documentation and update tests.

Eric-Sim added a commit to Eric-Sim/ansible_modules that referenced this issue Nov 8, 2021
…plete site data, and (optionally) prefixes
Eric-Sim added a commit to Eric-Sim/ansible_modules that referenced this issue Nov 8, 2021
Eric-Sim added a commit to Eric-Sim/ansible_modules that referenced this issue Nov 8, 2021
Eric-Sim added a commit to Eric-Sim/ansible_modules that referenced this issue Nov 8, 2021
…plete site data, and (optionally) prefixes
Eric-Sim added a commit to Eric-Sim/ansible_modules that referenced this issue Nov 8, 2021
Eric-Sim added a commit to Eric-Sim/ansible_modules that referenced this issue Nov 8, 2021
@rodvand rodvand linked a pull request Dec 11, 2021 that will close this issue
rodvand pushed a commit that referenced this issue Dec 27, 2021
* Enhancements for #640, Inventory module now pulls complete site data, and (optionally) prefixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant