Replies: 1 comment 2 replies
-
Right now, it's only a single config template per device. But what you could do as a workaround is to generate a single file with delimited sections, like the go playground does.
(I think there is a name for this format, but I can't find it right now) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm playing with Config Context and Data Sources.
I would like to pull "host variables" from my git repository and store it to the device. But the device itself has only Local Context Data which can be added only via JSON in the GUI.
Will it be replaced or modified to add host variables via a data source definition in some future release?
Also, I would like to append multiple Render Config Templates to the device.
So I could for example generate "running config" like template and a second template for the NetConf like running-config (XML)
Or just create smaller chunks of configuration.
For demonstration. My config template for device looks like this.
This template includes parts of other templates. But I'm not able to render just the Interfaces config.
For the 1st problem (assigning the device context data) I'm using Custom Field (local_context_data) which points to a Object of DataSource.
Then I can render the part of the template like:
Which refers to a
device.cf['local_config_context']
the caveat of this is, that the configuration data are not visible in https://netbox-instance/dcim/devices/DEVICE_ID/config-context/.For the 2nd problem (multiple config templates for a device) I'm trying to use Custom Field which refers to a Multiple Object of Configuration Template.
In this way, I think it is possible to render parts of template or a different templates at all but only via a CMD using the API calls.
Did somebody try some different ways to do these things?
Beta Was this translation helpful? Give feedback.
All reactions