Issue #1300 - nb_inventory injecting a variable as api_endpoint #1301
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes issue-#1300
allows api_endpoint to be a variable and string
Related Issue
#1300
New Behavior
calls the templar.template module to transform the api_endpoint if referenced as a variable e.g: "{{ fake_var }}"
Contrast to Current Behavior
fake_var: "https://netbox.test.domain.com"
Current behavior for a inventory file is referencing
api_endpoint: "{{ fake_var }}"
for the above example you would receive an error to the affect of
[WARNING]: * Failed to parse <location of your netbox plugin> with auto plugin: unknown url type: "{{ fake_var }}/api/status"
this solves that issue and the result is no error and we can see
Fetching: https://netbox.test.domain.com/api/status
Discussion: Benefits and Drawbacks
Changes to the Documentation
N/A
Proposed Release Note Entry
netbox.nb_inventory: api_endpoint option can now take variable calls E.G:
api_endpoint: "{{ netbox_url }}"
Double Check
devel
branch.