Replies: 2 comments 1 reply
-
It's not that sophisticated or complicated. Config Context are another way of storing group variables but your config management tool could just query for the primary_ip of Devices with the NTP service associated with them to get the list dynamically if you want rather than using the Config Context at all. Config Context is for manually specified data when you don't have another config management tool doing grouping and inheritance or you want to manage those values within Netbox and not within your config management tool.
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: MTex ***@***.***>
Sent: Friday, May 12, 2023 4:04 AM
To: netbox-community/netbox ***@***.***>
Cc: Subscribed ***@***.***>
Subject: [netbox-community/netbox] Inject Netbox Objects Data in Config Context (Discussion #12571)
Is it possible to reference Netbox Objects in Config Context ?
Let's say I am building a Config Context with my NTP Servers.
On the examples I see around, people hardcode the IPs on the JSON Config Context structure.
But....
I have my NTP devices modeled in Netbox already and those NTP devices have the Service "NTP" added to them with it's IP address.
Can I somehow reference the NTP IP Object of the Config Context instead of am hardcoded IP ?
—
Reply to this email directly, view it on GitHub<#12571>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UMZUKP3WRPQJPTRIZH3XFX4K3ANCNFSM6AAAAAAX7HQ6S4>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
I haven't tested the new config template and 3.5+ features yet, sorry for any misunderstanding. I don't know enough about the feature to answer the question of whether you can query the Django ORM directly from the Jinja2 template to populate something like an NTP config. Failing an ability to do that then statically configuring config_context data seems like the next best bet, with the additional burden of a regular review process or report to make sure the config_context IP list matches your service/tagging.
—
Mark Tinberg ***@***.***>
Division of Information Technology-Network Services
University of Wisconsin-Madison
…________________________________
From: MTex ***@***.***>
Sent: Monday, May 15, 2023 5:49 PM
To: netbox-community/netbox ***@***.***>
Cc: Mark Tinberg ***@***.***>; Mention ***@***.***>
Subject: Re: [netbox-community/netbox] Inject Netbox Objects Data in Config Context (Discussion #12571)
I see what you mean @mtinberg<https://github.com/mtinberg> but my question comes in the context of Netbox 3.5 new features.
With Netbox 3.5 you can render the device config directly from Netbox and in this scenario it doesn't make much sense to me to have to pre-render a config template elsewhere with a let's call it 3rd party system/scripts with information that already lives in Netbox and then send the template to Netbox to render a device config.
—
Reply to this email directly, view it on GitHub<#12571 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAS7UM2FKAFBD5V46OOW553XGKXHRANCNFSM6AAAAAAX7HQ6S4>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 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.
-
Is it possible to reference Netbox Objects in Config Context ?
Let's say I am building a Config Context with my NTP Servers.
On the examples I see around, people hardcode the IPs on the JSON Config Context structure.
But....
I have my NTP devices modeled in Netbox already and those NTP devices have the Service "NTP" added to them with it's IP address.
Can I somehow reference the NTP IP Object of the Config Context instead of am hardcoded IP ?
Beta Was this translation helpful? Give feedback.
All reactions