Replies: 2 comments 1 reply
-
If you show what you've done, maybe someone can spot the error. Export templates aren't really intended for generating device configs (they are intended to iterate over a list of devices), but it might be possible to (ab)use them for this purpose. The objects which you get from the queryset are of whatever object type you requested to export, but related objects can be found via accessors, e.g. 'object.interfaces' As an example, here's what I use for a custom link (which should be similar to export template) to link to the management IP address:
If you want to experiment with this, nbshell is a good place to play. |
Beta Was this translation helpful? Give feedback.
-
Thank you, this pointed us in the right direction on how to pull the Lo0. We were attempting something like the below. We are attempting to create small export templates for pieces of code long term. It seems like based on your example above, putting more information into config context vs pre-built areas would be more flexible as you cant always tie a value from the object (VRF, or IPAM info) {% for device in queryset %} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi All,
I'm working on setting up export templates to generate config for devices. I'm having a bit of an issue when trying to call some device specific information such as interface. For instance, if i set device for query set and pull data from config context, that works. But I also want to pull loopback interface IP, i keep on getting attribute error.
Wondering how i can map interface data and device data in same template?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions