-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Use constructable with NetBox dynamic inventory #45913
Conversation
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.
LGTM, a simple example or two would be nice too
5415677
to
28c2874
Compare
The test
|
df67008
to
36763a1
Compare
36763a1
to
a996153
Compare
@s-hertel I've added an example in the documentation. I've also tested and it works. Could we merge it? |
@gundalow Could we merge it? |
timeout: | ||
description: Timeout for Netbox requests in seconds | ||
type: int | ||
default: 60 | ||
compose: | ||
description: List of custom ansible host vars to create from the device object fetched from NetBox | ||
default: {} |
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.
Do we need version_added
here?
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.
Netbox is not present in 2.7 so I guess that all of it will be present for 2.8
a996153
to
9679e53
Compare
@gundalow Could we merge it? |
@s-hertel Could we merge it? |
@gundalow Could we merge it? |
@Anthony25 could you review? |
LGTM |
Merged into |
SUMMARY
As mention by @s-hertel in #45741 (comment)
Constructable
can be used to simplify inventory.The goal of this PR is to refactor the code of the NetBox inventory using Constructable to avoid adding new functions every time a new attribute for an host is added.
ISSUE TYPE
COMPONENT NAME
ANSIBLE VERSION