Replies: 1 comment 1 reply
-
Device mixes in ConfigContextModel: https://github.com/netbox-community/netbox/blob/v3.7.3/netbox/extras/models/configs.py#L160-L206 I believe you want If you're using it a lot, you may want to assign it to a jinja2 variable to avoid repeatedly recalculating it.
Above examples untested. |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
In the j2 - config-template I tried
{{device.config_context.ntp-server }}
{{device.config_context.ntp_server }}
In the swagger-ui It looks like this
"config_context": {
"ntp-servers": [
"1.1.1.1",
"2.2.2.2"
],
When I try to render it I got an error:
jinja2.exceptions.UndefinedError: 'dcim.models.devices.Device object' has no attribute 'config_context'
What ist the correct way to reference the config_context of a device in a config template
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions