You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not a big change to code if you add: self.api_endpoint = self.templar.template( self.get_option("api_endpoint"), fail_on_undefined=False)
to the nb_inventory plugin at
this will allow for the api_endpoint the option of being a variable all while maintaining it's ability to be a string.
Use case
In current Netbox Module the api_endpoint variable can only be a string. Ex: "https://netbox.at.your.domain.com"
If you try to inject a variable for api_endpoint like so api_endpoint: "{{ lookup('ansible.builtin.env', 'NETBOX_URL') }}"
The plugin will output that "{{ lookup('ansible.builtin.env', 'NETBOX_URL') }}"/api/status is not valid.
If you manage multiple environments with possibly different domain names this is quite useful. It allows you to define once in the code and carry it over to multiple environments while maintaining a credential with things like Ansible Controller vs changing your code.
External dependencies
N/A
The text was updated successfully, but these errors were encountered:
NetBox version
v3.19.1
Feature type
Change to existing Plugin
Proposed functionality
Not a big change to code if you add:
self.api_endpoint = self.templar.template( self.get_option("api_endpoint"), fail_on_undefined=False)
to the nb_inventory plugin at
this will allow for the api_endpoint the option of being a variable all while maintaining it's ability to be a string.
Use case
In current Netbox Module the api_endpoint variable can only be a string. Ex: "https://netbox.at.your.domain.com"
If you try to inject a variable for api_endpoint like so
api_endpoint: "{{ lookup('ansible.builtin.env', 'NETBOX_URL') }}"
The plugin will output that "{{ lookup('ansible.builtin.env', 'NETBOX_URL') }}"/api/status is not valid.
If you manage multiple environments with possibly different domain names this is quite useful. It allows you to define once in the code and carry it over to multiple environments while maintaining a credential with things like Ansible Controller vs changing your code.
External dependencies
N/A
The text was updated successfully, but these errors were encountered: